Deploy a Full VM with IPv4 Remote Desktop Connection (Windows, MAC, Linux)
Table of Contents
Introduction
In this Threefold Guide, we learn how to deploy a full virtual machine on a 3node on the Threefold Grid and access Ubuntu with a desktop environment to offer a graphical user interface (GUI).
This guide can be done on a Window, MAC or Linux computer. The only difference will be in downloading the Remote Desktop app. The steps should be very similar.
Server Side
Deploy a Full VM
- Go to the Threefold Playground
- Deploy a Full VM (Ubuntu 20.04)
- IPv4 Address
- After deployment, note the IPv4 address
- To SSH into the 3node, write in the terminal
-
ssh root@IPv4_address
-
Create a Root-Access User
- Once connected, update, upgrade and install the desktop environment
- Update
-
sudo apt update -y && sudo apt upgrade -y
-
- Install a light-weight desktop environment (Xfce)
-
sudo apt install xfce4 xfce4-goodies -y
- Choose between
gdm3
andlightdm
. In this guide, we chooselightdm
.
-
- Update
- Create a new user with root access (here
newuser
)-
adduser newuser
-
- To see the home directory of the new user, type the following
-
ls /home
- You should see the new user’s directory
- Give sudo capacity to newuser
-
usermod -aG sudo newuser
-
- Make the new user accessible by SSH
-
su - newuser
-
mkdir ~/.ssh
-
nano ~/.ssh/authorized_keys
- add authorized public key in file and save
-
- Exit the VM and reconnect with new user
-
exit
-
-
Install and Set XRDP
- Reconnect to the 3node server’ terminal to install XRDP
-
ssh newuser@IPv4_address
-
- Install XRDP
-
sudo apt install xrdp -y
-
- Check XRDP’s status
-
sudo systemctl status xrdp
- If not running, run manually:
-
sudo systemctl start xrdp
-
-
- If needed, configure xrdp (optional)
-
sudo nano /etc/xrdp/xrdp.ini
-
- Create an XRDP session with a root-access user
- Go to the home directory of the root-access user
-
cd ~
-
- Go to the home directory of the root-access user
- Create a session
-
echo "xfce4-session" | tee .xsession
-
- Restart xrdp
-
sudo systemctl restart xrdp
-
Set a Firewall
-
Find your local computer IP address
- On your local computer terminal, write
-
curl ifconfig.me
-
- On your local computer terminal, write
-
On the 3node terminal, allow client computer port to the firewall (ufw)
-
sudo ufw allow from your_local_ip/32 to any port 3389
-
-
Allow SSH connection to your firewall
-
sudo ufw allow ssh
-
-
Enable the firewall
-
sudo ufw enable
-
-
Verify status of the firewall
-
sudo ufw status
-
Client Side
For the client side (the local computer accessing the 3node server remotely), you can use remote desktop connection for Windows, MAC and Linux. The process is very similar in all three cases.
Simply download the app, open it and write the IP address of the 3node server. You will then need to write the username and password of the 3node server (in this guide, we used newuser
) to enter into your 3node.
Download the App
- Client side Remote app
Connect Remotely
- General process
- In the Remote Desktop app, enter the following information:
- IP Address of the 3node with the XRDP port (:3389)
- root-access username and password
- Connect to the 3node server remotely
- You should now have established a remote desktop connection to your 3node server
- In the Remote Desktop app, enter the following information:
Conclusion
After reading and completing this Threefold Guide, you should now have access remotely to the desktop screen of your 3node server.
If you have any questions, feel free to write a post on the Threefold Forum.