Sorry if it's wrong place to share that.
Introduction
Next guide will describe how to compile xrdp on your mac.
Why I need it because it's much more easy to manage mac computer from windows computer. You don't need to search vnc client you can simply use windows built-in rdp client. (and as for me during connection with VNC client to mac default VNC server aka ARD I have hanging of login screen very often, using XRDP possibility to see hanged vnc login screen reduced, why? i don't know...)
If you want just install it you can download Installer OSxXRDP.zip and simply install it. Installation will be done automatically (below i will describe how installer works).
Download OSxXRDP installer
But if you paranoiac and afraid of some code injections please follow by steps and compile it by yourself
Caution:
I'm really big mac hater (it's not related to Big'MC ) I don't like OS x and I'm pretty sure that OS x it's bad, old and outdated copy of Linux (it's mine IMHO so just keep in mind when you are reading that)
Preparation
I wouldn't describe how install x Code or command line tools you can find it over Internet or ask apple how to do that.
First step simply create folder for our project
Let's do that in the root of user folder.
Second step we need additional libraries to compile XRDP.
And my suggestion is to install wget (good linux tool to download files).
Download this file:
Download wget installer
Extract it (double click on file) and install pkg file.
Using wget you can simply download files from command line for example previous file can be downloaded with such command:
But if you don't have it yet use safari to download, if you have it you don't need it (I mean it's just example).
There is a few ways to install libs:
Third step Actually it's XRDP downloading.
Using wget just copy-paste this into shell (or you can use safari):
Now extract sources:
Patching
Now you need to apply patch. Really it can be compiled without this patch but.
Underlying story:
XRDP uses Unix standards to read environments. As I've told you mac it's just cripple Linux sometimes this function available sometimes not. It can be included into libSystem.B.dylib. It doesn't depend on version of mac os even when libs have the same version on one mac it's supported another no. I have suspicious that it's depends on version of x code, it seems mac devs unsucceeded to remove it from each tool and perform solution to make _environ function available but sometimes this function available even when x code wasn't installed maybe some another apple app can modify it too...
So you need to apply small patch to use native OS x calls into this os_calls.c file:
You can download this patch by link:
And actually the command to apply this patch:
Configuring and compilation
Run next:
Now we need to configure it properly:
Set defaults directories, set it as 32bit as I know there is some mac PCs with 32 bit os (yes PC because now mac it's IBM PC architecture) and target min version of OS x.
So in this case I think this binaries will run without problems when you want to transfer it to another mac.
After successful configuration run:
And finally to put binaries and all content into appropriate directories as root:
Configuring XRDP
You think that's all? Don't be so naive it's just begging...
xrdp.ini
So now we need to reconfigure XRDP with values for mac because it's configured as Linux tool.
Run next to change name of libs inside configuration:
After that edit this file and change max_bpp to 16 bit color because in some reason when you are trying to use 24 after connecting to mac vnc you will receive grey messed and very creepy screen (it's happened only when you using mstsc when you connecting from Linux everything fine). So to chnge it just run this:
Or you can download already modified xrdp.ini file and replace your own:
xrdp.sh
In some reason original xrdp.sh doesn't work correctly on mac (i don't remember what the reason). So you can try to fix it. Or simply download and replace. To do that run next commands:
rsakeys.ini
Please check now if rsakeys.ini exists:
If you see as output the name of file so you don't need to perform next command.
If answer that there is no such file so you need to run this:
So from here we are done to launch XRDP manually.
You can try:
And check result with:
You will see two process as an answer: xrdp, xrdp-sesman. If no you need to find what's wrong....
XRDP OS x daemon
Sure it's evidentially stupid idea to start xrdp every time manually.
So we need to create OS x daemon... It's really bad, pure documented system. But I've did that.
Download this description xml file:
Enable VNC aka ARD
And now don't forget to start VNC to which your XRDP instance will be connected.
You can do that using GUI settings of mac.
Or simply run this to activate access with the password 12345678 (you can change it):
So VNC will be enabled at port 5900 (you can try some custom vnc to change it if you want).
Installer
Installer assembled using packagemaker app from apple.
As I've mentioned above you can download it from here:
Download OSxXRDP installer
It contains few scripts and two packages.
That's all now you can launch you RDP client and connect to mac by IP
Introduction
Next guide will describe how to compile xrdp on your mac.
Why I need it because it's much more easy to manage mac computer from windows computer. You don't need to search vnc client you can simply use windows built-in rdp client. (and as for me during connection with VNC client to mac default VNC server aka ARD I have hanging of login screen very often, using XRDP possibility to see hanged vnc login screen reduced, why? i don't know...)
If you want just install it you can download Installer OSxXRDP.zip and simply install it. Installation will be done automatically (below i will describe how installer works).
Download OSxXRDP installer
But if you paranoiac and afraid of some code injections please follow by steps and compile it by yourself
Caution:
I'm really big mac hater (it's not related to Big'MC ) I don't like OS x and I'm pretty sure that OS x it's bad, old and outdated copy of Linux (it's mine IMHO so just keep in mind when you are reading that)
Preparation
I wouldn't describe how install x Code or command line tools you can find it over Internet or ask apple how to do that.
First step simply create folder for our project
Let's do that in the root of user folder.
Code:
$ mkdir ~/xrdp
Second step we need additional libraries to compile XRDP.
Code:
autoconf
automake
gettext
libtool
tree
And my suggestion is to install wget (good linux tool to download files).
Download this file:
Download wget installer
Extract it (double click on file) and install pkg file.
Using wget you can simply download files from command line for example previous file can be downloaded with such command:
Code:
$ wget "http://drive.google.com/uc?export=download&id=0BxdJaRbJyqkOWmhDOUdfNlhBdzg" -O wget-1.14_5.pkg.zip
There is a few ways to install libs:
- You can download installers for them using links (I've made them using macports)
Create folder to download them:
Code:$ mkdir ~/xrdp/deps
Download each installer into this folder:
autoconf:
Code:$ wget "http://drive.google.com/uc?export=download&id=0BxdJaRbJyqkOTG92alFFNkFaVGM" -O ~/xrdp/deps/autoconf-1_2.69_2.pkg.zip
Code:$ wget "http://drive.google.com/uc?export=download&id=0BxdJaRbJyqkOZmQyTG1HbXFCQXM" -O ~/xrdp/deps/automake-1.14.dmg.zip
Code:$ wget "http://drive.google.com/uc?export=download&id=0BxdJaRbJyqkOZHpGam15UVBaUW8" -O ~/xrdp/deps/gettext-0.18.3.1_1.pkg.zip
Code:$ wget "http://drive.google.com/uc?export=download&id=0BxdJaRbJyqkOby1MQVk4ZWpGb1k" -O ~/xrdp/deps/libtool-2.4.2_3.pkg.zip
Code:$ wget "http://drive.google.com/uc?export=download&id=0BxdJaRbJyqkOXzVyUl9hNV93cTg" -O ~/xrdp/deps/tree-1.6.0.dmg.zip
If you still want to use safari follow by this link and download each file:
Libs Installers
Extract each installer and install every sure you need root privileges for that.
If it doesn't work (then sorry sometimes it's happened) or again if you are paranoiac you can skip this steps and go to the 2nd or 3rd - It was my way.
You need install macports as described here: https://www.macports.org/install.php
When you have configured macports.
Invoke installation by typing in console:
Code:$ sudo port install autoconf $ sudo port install automake $ sudo port install gettext $ sudo port install libtool $ sudo port install tree
Sit back and relax. - Another way. It' using another repository such like homebrew.
http://brew.sh/
Brew doesn't need root so it's for you if afraid root a lot
Code:$ brew install autoconf $ brew install automake $ brew install libtool $ brew install gettext
I've didn't tried this way but I think it should work.
Because there is a man who tried this:
http://stackoverflow.com/questions/...xrdp-working-on-osx-lion-has-anyone-done-this - You can try another repo similar to macports or brew. Or you can try install libs from sources feel free
Third step Actually it's XRDP downloading.
Using wget just copy-paste this into shell (or you can use safari):
Code:
$ wget "http://downloads.sourceforge.net/project/xrdp/xrdp/0.6.0/xrdp-v0.6.0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fxrdp%2Ffiles%2F&ts=1359787244&use_mirror=iweb" -O ~/xrdp/xrdp-v0.6.0.tar.gz
Now extract sources:
Code:
$ cd ~/xrdp
$ tar xvzf "xrdp-v0.6.0.tar.gz"
$ cd ~/xrdp/xrdp-v0.6.0
Patching
Now you need to apply patch. Really it can be compiled without this patch but.
Underlying story:
XRDP uses Unix standards to read environments. As I've told you mac it's just cripple Linux sometimes this function available sometimes not. It can be included into libSystem.B.dylib. It doesn't depend on version of mac os even when libs have the same version on one mac it's supported another no. I have suspicious that it's depends on version of x code, it seems mac devs unsucceeded to remove it from each tool and perform solution to make _environ function available but sometimes this function available even when x code wasn't installed maybe some another apple app can modify it too...
So you need to apply small patch to use native OS x calls into this os_calls.c file:
Code:
--- ../xrdp-v0.6.0/common/os_calls.c 2012-02-21 11:00:55.000000000 -0800
+++ ../xrdp-environ/common/os_calls.c 2014-08-17 23:54:53.000000000 -0700
@@ -67,6 +67,9 @@
/* for clearenv() */
#if defined(_WIN32)
+#elif __APPLE__
+#include <crt_externs.h>
+#define environ *_NSGetEnviron();
#else
extern char** environ;
#endif
@@ -2113,7 +2116,7 @@
void APP_CC
g_clearenv(void)
{
-#if defined(_WIN32)
+#if defined(_WIN32) || defined(__APPLE__)
#else
environ = 0;
#endif
You can download this patch by link:
Code:
$ wget "http://drive.google.com/uc?export=download&id=0BxdJaRbJyqkOb09qMWwxQ2QycG8" -O ~/xrdp/os_calls.c.patch
And actually the command to apply this patch:
Code:
$ patch ~/xrdp/xrdp-v0.6.0/common/os_calls.c < ~/xrdp/os_calls.c.patch
Configuring and compilation
Run next:
Code:
$ ./bootstrap
Now we need to configure it properly:
Set defaults directories, set it as 32bit as I know there is some mac PCs with 32 bit os (yes PC because now mac it's IBM PC architecture) and target min version of OS x.
So in this case I think this binaries will run without problems when you want to transfer it to another mac.
Code:
$ ./configure -prefix=/usr -sysconfdir=/etc -localstatedir=/var CFLAGS="-m32 -mmacosx-version-min=10.6"
After successful configuration run:
Code:
$ make
And finally to put binaries and all content into appropriate directories as root:
Code:
$ sudo make install
Configuring XRDP
You think that's all? Don't be so naive it's just begging...
xrdp.ini
So now we need to reconfigure XRDP with values for mac because it's configured as Linux tool.
Run next to change name of libs inside configuration:
Code:
$ cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak
$ sudo sed -i 's/.so/.dylib/' /etc/xrdp/xrdp.ini
Code:
$ sudo sed -i 's/max_bpp=24/max_bpp=16/' /etc/xrdp/xrdp.ini
Or you can download already modified xrdp.ini file and replace your own:
Code:
$ wget "http://drive.google.com/uc?export=download&id=0BxdJaRbJyqkOTXFQeG9lRHRleEk" -O ~/xrdp/xrdp.ini
$ sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak
$ sudo cp ~/xrdp/xrdp.ini /etc/xrdp/xrdp.ini
$ sudo chmod 666 /etc/xrdp/xrdp.ini
xrdp.sh
In some reason original xrdp.sh doesn't work correctly on mac (i don't remember what the reason). So you can try to fix it. Or simply download and replace. To do that run next commands:
Code:
$ wget "http://drive.google.com/uc?export=download&id=0BxdJaRbJyqkOek5sOHZGNTRKQVk" -O ~/xrdp/xrdp.sh
$ sudo cp /etc/xrdp/xrdp.sh /etc/xrdp/xrdp.sh.bak
$ sudo cp ~/xrdp/xrdp.sh /etc/xrdp/xrdp.sh
$ sudo chmod 777 /etc/xrdp/xrdp.sh
rsakeys.ini
Please check now if rsakeys.ini exists:
Code:
$ sudo ls /etc/xrdp/rsakeys.ini
If you see as output the name of file so you don't need to perform next command.
If answer that there is no such file so you need to run this:
Code:
$ sudo xrdp-keygen xrdp /etc/xrdp/rsakeys.ini
$ sudo chmod 666 /etc/xrdp/rsakeys.ini
So from here we are done to launch XRDP manually.
You can try:
Code:
$ sudo /etc/xrdp/xrdp.sh
Code:
$ ps -A|grep xrdp|grep -v grep
850 ? 00:00:00 xrdp-sesman
851 ? 00:00:00 xrdp
You will see two process as an answer: xrdp, xrdp-sesman. If no you need to find what's wrong....
XRDP OS x daemon
Sure it's evidentially stupid idea to start xrdp every time manually.
So we need to create OS x daemon... It's really bad, pure documented system. But I've did that.
Download this description xml file:
Code:
$ wget "http://drive.google.com/uc?export=download&id=0BxdJaRbJyqkOdXppLVFLMGRsZFE" -O ~/xrdp/my.xrdp.plist
$ sudo cp ~/xrdp/my.xrdp.plist /Library/LaunchDaemons/my.xrdp.plist
$ sudo chmod 644 /Library/LaunchDaemons/my.xrdp.plist
$ sudo launchctl load -F /Library/LaunchDaemons/my.xrdp.plist
$ sudo launchctl start my.xrdp
Enable VNC aka ARD
And now don't forget to start VNC to which your XRDP instance will be connected.
You can do that using GUI settings of mac.
Or simply run this to activate access with the password 12345678 (you can change it):
Code:
$ /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw 12345678 -restart -agent -privs -all
So VNC will be enabled at port 5900 (you can try some custom vnc to change it if you want).
Installer
Installer assembled using packagemaker app from apple.
As I've mentioned above you can download it from here:
Download OSxXRDP installer
It contains few scripts and two packages.
- First script will run before start to check your current language if it's Russian language simply exit. You will pass it without problems it's only for Russians why because they're invaders and they support their government in this actions. (Sure it's simply to skip but at least maybe they will think why I did that...)
- Just go through the dialogs (maybe you'll be asked about choose drive... due to some apple bug sometimes it can ask sometimes no)
- By default two packages available and marked: one for binaries another one for daemon. So normally you need both.
- After finish you will see such screen and you can try to check if services where started.
That's all now you can launch you RDP client and connect to mac by IP
Attachments
Last edited: