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?
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
.xsessionfile 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
#!/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:
(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 line
mate-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)
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:
- New session
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
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
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
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):
The go-to solution if all you want is a text terminal via SSH.
PuTTY is installed on Windows. On Ubuntu, install the SSH server:
sudo apt install openssh-server
It is very convenient as it integrates both an xterm emulator and SSH / telnet and other protocols in a single package.
tmux attach to the mix, and you can use the exact same terminals on work and at home, which is amazing. There are however some annoying glitches with environment variables, particularly
You will also want to reduce the default huge font size: Increase font size of putty
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 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