XRDP is great

xrdp.org hosts an open-source implementation of Microsoft’s remote desktop protocol server. This is a great tool long overdue on GNU/Linux.

Remote Desktop Protocol (RDP) is a proprietary protocol developed by Microsoft, which provides a user with a graphical interface to another computer. Unlike VNC which simply forwards screen shots and keyboard input from another computer, A RDP session is a virtual terminal creating a separate instance of X.org server running a desktop separate from other logged in users. No users need to be logged in to create a new RDP session.
This means the session can be configured by the client so the screen is displayed in the native resolution of the client. Using a RDP client at full screen feels like your using a native operating system. Its also more efficient in terms of bandwidth needed to communicate video and keyboard data.

Installing in ubuntu 11.10 is easy. Its a package which can be installed with apt-get.

sudo apt-get install xrdp

Great, but I encountered a couple of minor issues.
For one after connecting with a client, I was only able to see the desktop. I did not get tool bars or any way to interact with the terminal.
Turns out its an easy fix.

cd /home/youruser
echo "gnome-session --session=ubuntu-2d" > .xsession
sudo /etc/init.d/xrdp restart

This tells xrdp to use ubuntu-2d for your remote session.
This is all I needed to get my menus to show up. Note that restarting xrdp will disconnect your session.

The next issue is pressing the ‘d’ key causes all active windows to be hidden. This can be corrected from the GUI.

  • Click on the ubuntu menu and search for ‘system settings’.
  • Click on ‘keyboard’.
  • Click on the ‘shortcuts’ tab, then the ‘navigation’ tab and find ‘Hide all normal windows’. I changed mine to be ‘alt + d’ .

Once these easy tweaks are done, you’ll have your self a very usable remote desktop server.

O to Dev in 10 seconds with Ubuntu

The end result is to take a based install of ubuntu 10.x desktop and make it ready for php web development.

These commands download about 500MB of software.

Run it line by line as root or make a bash script out of it.


#All of these steps must be done as root.
if [ "$(whoami)" != 'root' ]; then
echo "This script must be run as root."
exit 1;

#Add the zend repo to apt.
echo "deb http://repos.zend.com/zend-server/deb server non-free" >> /etc/apt/sources.list

#Add zend's signing key to the apt key ring so we can use the zend repo.
wget http://repos.zend.com/deb/zend.key -O- | sudo apt-key add -

#Add yogarine's repo so we can download the latest version of eclipse and the php development tools.
add-apt-repository ppa:yogarine/eclipse/ubuntu

# Update your repo cached software list.
apt-get update

#Install eclipse with php development tools (latest), zend server (apache, php, and php control panel), mysql (cli client and server) in a single command.
apt-get install eclipse-pdt zend-server-ce-php-5.3 php-5.3-extra-extensions-zend-server-ce mysql-server mysql-client phpmyadmin

Post install Tasks:

Reboot your computer.
Eclipse will install openJDK and you must restart to complete the installation.

Visit to complete the setup of your zend server control panel.

Setup your document root.
I usually make a directory in var for my workspace and point eclipse to that location like so.

cp /var/www/*.php ~/workspace/
sudo rm -f -r /var/www
#Replace $USER with your login name.
sudo ln -s -v ~/home/$USER/workspace/ /var/www

To access the debugger from PDT, add the following get variables to your request:


FTP access to an ESXi datastore

Or how to get your stuff off an ESXi ‘free edition’ box.

FTP server

There are many ways to get at your datastores on an ESXi box.
The web interface. You could enable support mode and scp files around. Or you could even use the datastore browser in the vsphere client.

I however was looking for a way to move these large data files onto another linux storage server.
In my case, the web ui and scp were extremely slow. At their current rate, it was going to take days to copy all my stuff off.

That’s when I came across Dave’s article on how to enable a FTP server on an ESXi box. Again using static binaries. Lovely.

I condensed the process in to a shell script. Just download this archive.
Unzip and run the install.sh script in the recovery console.

This will copy the files into the correct locations, change their permissions and add them to the inetd.conf file.
Remember; with ESXi, these changes only persist until the next reboot.
Any user account in ESXi will be able to login via FTP.

Its FTP folks. Don’t try this on an untrusted network.
Your info is going across the wire in plain text.
…its going so fast… Should be done by tomorrow.

The complicated process for removing the “uncomplicated firewall”

If your new to linux, ufw is very useful tool. Really simple to install with ubuntu.

However, should you choose to get rid of it for some reason, it leaves behind quite a mess.
Here is a quick script to clean up the mess.

Here is the whole process as a bash script:

iptables -P INPUT ACCEPT
iptables -X ufw-user-output

iptables -X ufw-user-logging-output
iptables -X ufw-user-logging-input
iptables -X ufw-user-logging-forward
iptables -X ufw-user-limit-accept
iptables -X ufw-user-limit
iptables -X ufw-user-input
iptables -X ufw-user-forward
iptables -X ufw-track-output
iptables -X ufw-track-input
iptables -X ufw-skip-to-policy-output
iptables -X ufw-skip-to-policy-input
iptables -X ufw-skip-to-policy-forward
iptables -X ufw-reject-output
iptables -X ufw-reject-input
iptables -X ufw-reject-forward
iptables -X ufw-not-local
iptables -X ufw-logging-deny
iptables -X ufw-logging-allow
iptables -X ufw-before-output
iptables -X ufw-before-logging-output
iptables -X ufw-before-logging-input
iptables -X ufw-before-logging-forward
iptables -X ufw-before-input
iptables -X ufw-before-forward
iptables -X ufw-after-output
iptables -X ufw-after-logging-output
iptables -X ufw-after-logging-input
iptables -X ufw-after-logging-forward
iptables -X ufw-after-input
iptables -X ufw-after-forward
apt-get remove ufw
#As a basic firewall I’d recommend the following:
iptables  -F
iptables  -A INPUT -m state –state RELATED,ESTABLISHED -j ACCEPT
iptables  -A INPUT -i lo -j ACCEPT
iptables  -A INPUT -p tcp -m tcp –dport 80 -j ACCEPT
iptables  -A INPUT -p tcp -m tcp –dport 443 -j ACCEPT
iptables  -A INPUT -p tcp -m tcp –dport 13160-j ACCEPT
iptables  -A INPUT -d XX_REPLACE_WITH_YOUR_SERVER_IP/32 -p icmp -m icmp –icmp-type 8 -m state –state NEW,RELATED,ESTABLISHED -j ACCEPT
iptables  -A INPUT -d XX_REPLACE_WITH_YOUR_SERVER_IP/32 -p icmp -m icmp –icmp-type 0 -m state –state RELATED,ESTABLISHED -j ACCEPT
iptables -P INPUT DROP
iptables -P FORWARD DROP
This will:
Reset the default policy of INPUT to ACCEPT so we don’t get locked out of our box.
Then  remove the custom ufw chains, flush all existing rules, accept established connections, accept all connections on loopback device, accept all connects to ports 80(http),443(https), and 22(sshd)
It will also accept pings from machines which have established a connection. With large packet support now enabled by default in the linux kernel, its important to allow some pings to be accepted. Then we set the default policys of input and forward to drop and output to accept.
Make sure you replace XX_REPLACE_WITH_YOUR SERVER_IP with your servers ip address.

Install errors from missing locales

While setting up a lamp stack in a VPS using ubuntu 10 LTR, I got the following error:
Setting up php5-cli (5.3.2-1ubuntu4.5) ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.utf8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C")

I was also getting a similar error from locale -a
locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory

It appears this VPS provider doesn’t have any locales installed by default. I fixed it by installing my locale via apt-get.

apt-get install language-pack-en-base


Update – 1-23-2011

If your using debian instead of ubuntu, see http://people.debian.org/~schultmc/locales.html

  1. Install debconf (i.e. run apt-get update then apt-get install debconf, as root)
  2. Run dpkg-reconfigure locales as root