I have Ubuntu installed on my work computer. I am wondering whether I could have access to it from another computer with Windows installed. If so, could you give a step by step guide?
-
1You could ask your IT department whether or not secure shell is installed, then connect to your work computer using PuTTY – Sergiy Kolodyazhnyy Mar 04 '15 at 07:12
-
1Added an answer, give it a try – Faizan Akram Dar Mar 04 '15 at 07:18
-
1You can use any one of following.
- PuTTY
- VNC
-
Is this work computer at work? Does your work allow remote connection? Firewalls? – damien Mar 04 '15 at 12:51
-
1Yes you can. Check out the first answer for this question, url below. It is the easiest and fastest working solution. Tested it myself. http://askubuntu.com/questions/477947/what-do-i-need-for-remotely-accessing-my-ubuntu-14-04-desktop – Ubuntuser Jan 13 '16 at 06:00
-
Does anyone have any relevant updates now that Ubuntu (22.04.2) has Desktop sharing solution baked in? I still cant get an RDP connection to work between a Win PC and ubuntu on the same simple home network... – Paul Eden Feb 24 '23 at 20:57
4 Answers
Yes, you can access Ubuntu from Windows remotely.
Taken from this article.
Follow these steps :
Step 1 – Install xRDP
Open Terminal (Crtl+Alt+T) and execute the following commands:
sudo apt-get update sudo apt-get install xrdp
Step 2 – Install XFCE4 ( Unity doesn't seem to support xRDP in Ubuntu 14.04; although, in Ubuntu 12.04 it was supported ). That's why we install Xfce4.
sudo apt-get install xfce4
Step 3 – Configure xRDP
In this step, we modify two files to make sure xRDP uses Xfce4. First we need to create, or edit, our
.xsession
file in our home directory. We can either use nano or simply redirect an echo statement (easier):echo xfce4-session > ~/.xsession
The second file we need to edit is the startup file for xRDP, so it will start Xfce4.
sudo nano /etc/xrdp/startwm.sh
The content should look like this (pay attention to the last line and ignore
. /etc/X11/Xsession
):#!/bin/sh if [ -r /etc/default/locale ]; then . /etc/default/locale export LANG LANGUAGE fi startxfce4
Step 4 – Restart xRDP
To make all these changes effective, restart xRDP as such:
sudo service xrdp restart
Testing your xRDP connection
On the computer that will remotely control your Ubuntu machine, start you RDP client. Windows comes standard with a Remote Desktop client (mstsc.exe – you can start it from a command prompt, or find the shortcut to Remote Desktop under Accessories). Or Search 'remote' in start (Windows 7) Or 'remote' in search box in Windows 8.
Whichever client you use, most will work with either the computer network name or IP address of your Ubuntu machine.
To find the IP address on your Ubuntu box, type:
hostname -I
(note: this is a capital “i”)
Enter IP address of your Ubuntu machine. For example:
Depending on your RDP client capabilities and settings (for example: Microsoft RDP Client allows automatic login), you might or might not see the login screen. Here we enter our Ubuntu username and password and click “OK”
You are done,enjoy
PS: There are some good points mentioned in comments, so I thought to sum them up.
If you want to access Ubuntu from outside network, you'll need your Ubuntu at work to have it's own, proper, internet IP address - a fairly unlikely scenario. To work it otherwise, you need the externally visible address of work, AND have port forwarding set to direct incoming RDP requests to your work computer on the router. (Mark Williams)
To use the Ubuntu MATE desktop
meta-session
, replace last linestartxfce4
instartwm.sh
withmate-session
. (Frank N)You can use your actual machine name (by typing
hostname
) rather than your IP as it might be more stable on dynamic IPs in future sessions. (Frank N)

- 4,511
-
8Odds are this will hit trouble, if the OP means from outside - your example uses a 192.168.1.* address, which is reserved for internal networks - it won't cross the internet. You'll need your Ubuntu box at work to have it's own, proper, internet IP address - a fairly unlikely scenario. To work it otherwise, you need the externally visible address of 'work', AND have port forwarding set to direct incoming RDP requests to your work computer on the router. OK if inside the network though – Mark Williams Mar 04 '15 at 08:42
-
5I have an Ubuntu server and a Windows machine at home, and I'm trying to connect the latter to the former. I followed the instructions above, but after I log into xrdp, all I get is a dialog that says "Connecting to sesman ip 127.0.0.1 port 3350" with an 'OK' button, and nothing more. Any idea why? – Yuval Jan 17 '16 at 18:22
-
1Is ubuntu server and windows on the same network? I mean are you connecting them locally or via internet? Add IP address of your sever on windows machine as shown above, if both systems are on the same local network then the address of the both would be something like 192.xxx.xxx.xxx . If you are connecting across internet then you need to add IP address of remote machine and allow port forwarding on your router, Search google for
port forwarding
– Faizan Akram Dar Jan 18 '16 at 18:03 -
2hint: To use the ubuntu MATE desktop meta-session, replace last line
startxfce4
in startwm.sh withmate-session
– Frank N Feb 13 '16 at 18:30 -
2using your actual machine name (by typing
hostname
) rather than your IP might be more stable on dynamic IPs in future sessions... – Frank N Feb 14 '16 at 12:13 -
All else works great, but I am getting desperate on getting clipboard to work.. ➝ https://www.mankier.com/5/xrdp.ini#Channels ?!? – Frank N Feb 14 '16 at 12:59
-
I entered credentials to xRDP - it shows the connecting information. But screen came blank with 'X' cursor mark and suddenly it threw me out. Any clue? – Gaurav Arora Jun 10 '16 at 07:39
-
-
1
-
1Anyone knows how to get clipboard and audio/sound to work? Also gnome-terminal is dysfunctional, although it can be used to call up xterm, which works fine. – Leo Jun 18 '16 at 09:56
-
coppied from :http://www.tweaking4all.com/software/linux-software/use-xrdp-remote-access-ubuntu-14-04/ – devprashant Sep 15 '16 at 04:02
-
xrdp does not start on boot, so make sure a script runs this line on boot
service xrdp start
– xinthose Sep 20 '16 at 18:40 -
i enter login and password, and then i get a blue screen with the mouse pointer and nothing else. any idea? – David Portabella Nov 02 '16 at 02:00
-
@DavidPortabella which version of ubuntu and windows are you trying to connect – Faizan Akram Dar Nov 02 '16 at 03:24
-
the last ubuntu xenial version. about windows, i use a RDP client from OSX, but this should not matter. – David Portabella Nov 02 '16 at 15:30
-
This article explain the whole thing in very simple manner No need to install any additional apps http://www.makeuseof.com/tag/ubuntu-remote-desktop-builtin-vnc-compatible-dead-easy/ – TMKasun Nov 02 '16 at 16:36
-
i managed to connect with vnc using this tutorial: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-16-04 but I get a totally different desktop manager. – David Portabella Nov 02 '16 at 21:16
-
ok, i managed to connect using the default sharing desktop, as tmkasun said. the problem is that i couldn't find the preferences. running the command "vino-preferences" showed the dialog box, and i could enable it. – David Portabella Nov 02 '16 at 22:38
-
1
-
1Tip : Make sure sesman is running by typing
/usr/sbin/xrdp-sesman
. Otherwise you might get a blank screen with a big X on it. – spunkpike Dec 17 '16 at 04:51 -
I had to reboot my computer to get this to work. Simply restarting the service did not work. I also had to use sesman-any and 127.0.0.1 as the ip address to get it to work from the RDP client. – Michael Earls Apr 17 '17 at 20:00
-
I know this is an old thread, so maybe info is out-of-date with Ubuntu 16.04.3 LTS, but I get the same behavior as Yuval. Windows RDP appears to find host and connect just fine, and I get "Login to xrdp" dialog, where I enter my Ubuntu login info...
But then just get "Connection Log" dialog, that says "connecting to sesman ip 127.0.0.1 port 3350". There is only an "OK" button, and clicking on that closes the connection entirely.
Windows and Ubuntu machines are on the same internal network (home). I can ssh into the Ubuntu machine from the same Windows machine w/ PuTTY.
Why?
– Carl S Oct 27 '17 at 03:45 -
@FrankNocke: will
mate-session
give you the current logged-in session of the target computer? – Superole Oct 29 '17 at 11:29 -
Sorry, don't know. And don't have my session settings handy right now... @super – Frank N Oct 31 '17 at 11:03
-
The first time I ever exposed a linux system to the internet for remote connectivity many years ago (though it was also a web server) without a hardware firewall, that machine was hacked in about two weeks. So be sure to not overlook security concerns. – devinbost Nov 03 '17 at 20:40
-
-
after install xfce sucessfully, when I run
echo xfce4-session >~/.xsession
it return this error:-bash: /home/longnx/.xsession: No such file or directory
https://imgur.com/a/AcCuAOv What can I do? What keyword to search for help? – Luke May 11 '18 at 04:20 -
1@luke There is a space between > and ~,
echo xfce4-session > ~/.xsession
. It should work, if it doesn't use nanonano ~/.xsession
and copy contents ofecho xfce4-session
into it – Faizan Akram Dar May 16 '18 at 17:00 -
echo xfce4-session > ~/.xsession
doesn't the single>
mean it'll completely overwrite~/.xsession
? – TheWanderer Jul 13 '18 at 16:06 -
-
Thanks for the answer. Can you give us a little more details of how we can use https://www.noip.com/ so we can have a static name of linux machine? Thanks in advance, Chris Pappas – Chris P Aug 07 '18 at 10:57
-
This worked on Xubuntu 14.04 and 16.04. It is failing for me on 18.04 – user628388 Nov 05 '18 at 02:46
-
I had problems connecting on Ubuntu 18.04 - session would start and then quit immediately. This page was very helpful: https://github.com/neutrinolabs/xrdp/issues/1128 – Callidus Dec 29 '19 at 20:41
MobaXterm
Freeware implementation the X server on Windows.
This method qequires minimal setup, and is very reliable.
You must first install the SSH server on Ubuntu e.g. by physically accessing a keyboard on the machine:
sudo apt install openssh-server
Then, on Windows within MobaXterm, you go:
- Sessions
- New session
- SSH
which gives you an SSH shell.
Now, if you start a program from that shell, e.g.:
sudo apt install x11-apps
xeyes
xeyes
opens as a separate native Windows window.
One annoyance is that if you opened the window at work, and then you get home, you have to start a new instance of the app, and you can't see the already opened window. This is made further annoying by applications that work in single window mode, e.g. browsers: you will have to search for how to force a new instance, and then you will have two instances running.
Tested in Windows 10 and Ubuntu 19.10 on a local network with MobaXterm v12.4:
- xeyes 7.7: move pretty fast, but you have to be hovering the window itself
- Firefox 74.0: page scrolls were pretty sluggish nearing unsability, I would not be a happy user
- Eclipse 2020-03: works surprisingly well, I can see a bit of lag, but pretty small, even when scrolling, and trying to watch a video on YouTube makes it unresponsive
- Chromium 79: can't open it, error message: "MoTTY X11 proxy: Unsupported authorisation protocol" asked at: https://superuser.com/questions/1111900/how-to-fix-mobaxterm-x11-proxy-unsupported-authorisation-protocol
Here is a Windows screenshot showing MobaXterm running on top left, and two program (xeyes and firefox) running on the Ubuntu remote but showing as separate native Windows windows!
MobaXterm X server alternatives
I haven't tried those yet, but behavior should be similar to MoabXterm? Hopefully we can find a good open source one then:
- Cygwin/X https://x.cygwin.com/ demo video: https://youtu.be/ENkOEknSLv4?t=105
- Xephyr: https://en.wikipedia.org/wiki/Xephyr MIT licensed. I can't find out how to download a prebuilt in 5 minutes.
- Xming: https://en.wikipedia.org/wiki/Xming another proprietary one
xrdp
Mentioned at: https://askubuntu.com/a/592544/52975
I just want to confirm that it does not work without touching some configuration files as mentioned in that answer from Windows 10 into Ubuntu 19.10, you just get a black screen in that case: Blank desktop when logging in via xrdp
Also RDP is a proprietary Microsoft protocol which is saddening: https://en.wikipedia.org/wiki/Remote_Desktop_Protocol But it does appear to send only minimal information unlike VNC which sends images: https://superuser.com/questions/32495/whats-the-difference-between-rdp-vs-vnc
VNC
I've tried the following programs, but they were sending the desktop as video, which incurred unacceptable screen resolution loss / mouse inaccuracy / network bandwidth if you are offsite.
Servers (run on Ubuntu):
- Vino. Ships pre-installed, but there are compatibility issues with some available Windows clients: Gnome 3.10 sharing desktop --- how to configure the security type for VNC?
Clients (run on Windows):
- TigerVNC
PuTTY
https://www.chiark.greenend.org.uk/~sgtatham/putty/
The go-to solution if all you want is a text terminal via SSH.
First you have to install PuTTY on Windows, usually by downloading it from its website.
On Ubuntu, install the SSH server:
sudo apt install openssh-server
and then you just open PuTTY, tell it the Ubuntu IP and connect via SSH, and that gives you a terminal inside Ubuntu.
PuTTY is very convenient as it integrates both an xterm emulator and SSH / telnet and other protocols in a single package.
Then you also want to install and use tmux
on Ubuntu and use tmux attach
when connecting from Windows from within PuTTY as mentioned at https://unix.stackexchange.com/questions/22781/how-to-recover-a-shell-after-a-disconnection, this way you can:
- use the exact same terminals on work and at home. Yes, terminal windows get updated in real time on both machines if you type anything in either! The magic of servers!
- not lose any sessions if the connection breaks
which is amazing!!! There are however some annoying glitches with environment variables, particularly DISPLAY
: https://unix.stackexchange.com/questions/75681/why-do-i-have-to-re-set-env-vars-in-tmux-when-i-re-attach
You will also want to reduce the default huge default font size: Increase font size of putty
How to copy paste in PuTTY: https://superuser.com/questions/180043/how-do-i-paste-the-windows-clipboard-into-my-putty-session-using-only-the-keybo
Then, you can just open webpages you need directly on the native Windows browser. If all you need to get your work done is Vim and and a browser, PuTTY is definitely the way to go. The only thing I miss on my development day-to-day with this setup is Eclipse.
vscode and other SSH-supported IDEs
If you're a programmer, you already know this, but here goes.
With vscode, you can using only SSH, easily setup a remote vscode server, which allows you to:
- browse, edit and download files and directories
- get an SSH shell
with perfect integration between the two, e.g. Ctrl + Click on SSH terminal paths open the clicked file on the editor.
In a sense, this should cater for all your non-GUI application access needs.

- 28,474
The best one I found is x2go.
Install on the linux machine http://wiki.x2go.org/doku.php/doc:installation:x2goserver
Install client on the windows machine: http://wiki.x2go.org/doku.php/download:start
Tune compression if it feels slow: (TL;DR use 4k-png) https://uwaterloo.ca/science-computing/student-support/x2go-tutorial

- 426
- 1
- 4
- 10
-
Good one! Because it also supports on-demand desktop sharing / remote support (see). – tanius Apr 11 '19 at 13:35
-
While much easier than xrdp, this method is a bit resource incentive for Raspberry Pi with limited processor and RAM. But this was the easiest of all. – jahajee.com Jun 30 '20 at 10:23
Powershell on Windows has already delivered Windows SSH solution back in 2015 and you can just have a try.

- 35,660