Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an Ubuntu virtual machine to which I need to do remote desktop. I do not have physical access to that machine and I can do only ssh to the machine. I wanted to do remote desktop and came up with lot of options (vnc, xrdp, opennx). I used xrdp and I installed the necessary packages in the ubuntu machine (xrdp and dependent). Then I enabled the remote access in the ubuntu using the following command line option.

gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled true

gconftool-2 -s -t bool /desktop/gnome/remote_access/prompt_enabled false

Then I restarted the xrdp (/etc/init.d/xrdp start). But when I try to do rdp using the windows client (mstsc), I get the following error. Remote access to the server is not enabled.

How do I solve this? Kindly help.


share|improve this question

Welcome to Ubuntu Community.

First of all Check Network Settings of windows Virtual Machine in Virtual Box. Choose Bridge Connection in Network settings.Check that RDP is allowed to pass through Firewall of Window Client.

share|improve this answer
Hi.. i am able to do ssh. Can you please tell me how to chek whether RDP is allowed to pass through firewall – user1667630 Jan 1 '13 at 5:36
Ya, Open firewall settings in Windows client, You will get list of programs and services that are allowed to pass, Find RDP, Click on edit , Enable and apply. – K.K Patel Jan 1 '13 at 5:38
It was already enabled !! I checked it.. Is there any other way to get the UI of the ubuntu. One more problem is only port 22 is enabled in the ubuntu .. – user1667630 Jan 1 '13 at 5:42
Turn Off Ubuntu Firewall using command service iptables stop – K.K Patel Jan 1 '13 at 9:58

I'm not familiar with xrdp in particular, but the first thing I'd check is to see if the port its using is a) listening for connections and b) open to the outside world. The default port for RDP is 3389.

The first is pretty easy to check; simply run this in terminal on the machine you're trying to connect to (change 3389 if xrdp is listening on a different port):

netstat -an | grep "LISTEN " | grep ":3389"

If you get something similar to the following, something at least (hopefully xrdp) is listening for connections:

tcp        0      0  *               LISTEN

If you don't get any output, try (re)starting xrdp or check to make sure you have the right port.

Next, you need to make sure that the machine is accessible to the Internet on that port, which involved two things: making sure that the firewall on the machine itself isn't blocking connections to that port, and making sure that any network device (i.e. a router) between the computer you're trying to connect to and the Internet isn't blocking connections. can help with the latter; the first depends on what kind of firewall is installed on your machine, if any.

Hope this helps!

share|improve this answer
Below is the output of the netstat.. I will check the second part and let you knwo.. tcp 0 0* LISTEN – user1667630 Jan 1 '13 at 5:48
OK, good, that means that xrdp is listening for connections. You did say that you can only access the virtual machine on port 22, though, which would be why the RDP client can't connect. What virtual machine software are you using? – stevenmirabito Jan 1 '13 at 5:49
I am sorry.. can you please tell what you mean by "virtual machine software"... In the ubuntu, I just installed xrdp.. – user1667630 Jan 1 '13 at 5:52
You said in your OP: I have a virtual machine (ubuntu) to which i need to do remote desktop. What software is the virtual machine running under (VirtualBox, VMware, Virtuozzo, Xen, OpenVZ, etc.)? Is this a machine on your local computer or is it a VPS hosted somewhere? – stevenmirabito Jan 1 '13 at 5:55
sorry.. yeah.. it is a VPS hosted somewhere !! Basically it uses Apache Software Foundation's solution .. Virtual Computing Lab !! – user1667630 Jan 1 '13 at 5:57
sudo ufw disable 

then try logging in using your rdp.. client software. I am in the process of setting this up for 12.04 linux vps, so far i got connected but not seeing a desktop only a command window.

Hi bud, you said you got connected and all you see is a terminal window, i dont know what your complete set up is but here,s mine i hope it helps.

Be sure your vncserver is running by vncserver :1 next nano into ~/.vnc/xstartup this brings you to a bin!! bla bla file, where you see the last line (& -x-window-manager), add & /etc/X11/Xsession &

Now go into this file, /etc/xrdp/ and be SURE IN THERE, your last line is

. /etc/X11/Xsession

after doing so restart the vncserver by doing this.

vncserver -kill :1 

then restart

vncserver :1

By the way i had to install more than just the Xrdp and i did a few more commands for a fall back if Xrdp failed, all seems good at the minute for me, give it a go sure and lets know whats cooking or not. Good luck. Ps.. its frecking great when it works, stay with it.

share|improve this answer

I finally got this to work for me; setup: older laptop running ubuntu 13.10 running standard unity; I have installed cairo dock (which makes it much more usable for me); still not used to the left side app bar;

It would be nice to be able to use my win7 system to rdp into this ubuntu 13.10 so I spent a couple of hours this morning doing research. Here is what I did:

sudo apt-get update
sudo apt-get install xrdp

or you could use ubuntu software center to install.

The installation appeared to go ok and it appeared that the xrdp service was started ok.

From my win7 box, I opened an rdp window and used the laptop's IP address to get in; a window did open up but just a standard x11 windows screen (cross-hatch pattern with x cursor); no links, icons or menus to use.

More google research. I installed the gnome-session-fallback:

$ sudo apt-get install gnome-session-fallback
$ echo "gnome-session --session=gnome-fallback" > ~/.xsession

This didn't work; I got the same blank screen, but found another URL that suggested another windows session mgr like XFCE, so I installed xubuntu desktop:

$ sudo apt-get install xubuntu-desktop
$ echo "xfce4-session" > ~/.xsession

Don't forget to sudo /etc/init.d/xrdp restart after all the changes.

This worked. At first, on initial start-up of rdp session, I got the same blank screen but after 10 seconds (probably because I am using a win7 VDI at work from a remote location) up popped a usable xfce xubuntu desktop; not as nice as gnome but very usable.

Hope this info will be useful, as I couldn't get the initial attempts to work for me.


share|improve this answer

If only port 22 is being permitted through the firewall, and you lack control over your network path, you may want to use ssh tunneling to tunnel your chosen port on the remote box through to your local system.

If doing this from a Linux/Unix box look at the -L flag for ssh:

ssh -L 3390: -l remote_user remote_host

where the first 3390 is the local port number and the second 3389 is the remote port number; you would then RDC to to connect. Note that the tunnel is tied to the ssh session - if you close that ssh session, the tunnel will also close and your connection to the remote desktop will drop. Make sure you use an unused port for the local side.

If connecting from a Windows system use putty and enable the ssh tunnelling options for your session (look at connection->SSH->Tunnels in the session configuration options.)

Once the tunnel is established you can use your chosen RDP client to connect. Several of the other answers address this part of the setup (personally I wound up following the xfce4-session suggestion.)

share|improve this answer

Run the commands in terminal:

sudo apt-get install xrdp
sudo apt-add-repository ppa:ubuntu-mate-dev/ppa
sudo apt-add-repository ppa:ubuntu-mate-dev/trusty-mate
sudo apt-get update 
sudo apt-get upgrade
sudo apt-get install ubuntu-mate-core ubuntu-mate-desktop

echo mate-session >~/.xsession
sudo service xrdp restart
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.