Optimize Your Remote Work: Setting Up a Self-Hosted Desktop

A growing number of professionals are turning to self-hosted remote desktops to enhance their work flexibility. This approach allows users to run operating systems like Ubuntu or Windows on a virtual machine (VM) while accessing them remotely. By setting up a self-hosted remote desktop within a VM, users can achieve performance that closely resembles running directly on physical hardware, regardless of their travel circumstances.
For frequent travelers who rely on a single device, such as a MacBook equipped with an M1 Pro chip, accessing multiple operating systems can prove challenging. The limitations of resource allocation often hinder performance, particularly when using virtualization software directly on the host machine. A self-hosted remote desktop solution offers a practical alternative by enabling users to leverage more powerful systems located at home.
Setting Up Your Home Lab
To begin, download VirtualBox, a popular virtualization tool, and install it on your host machine. Consider adding the Extension Pack for improved functionality. Users can then acquire an ISO image of the desired operating system, such as Ubuntu, which provides a lightweight option for remote access.
Initiate the creation of a VM by selecting “New” in VirtualBox, then input the ISO file, name your VM, and designate appropriate resources. It is advisable to allocate a minimum of 4GB of RAM and 20 to 30GB of storage to ensure optimal performance. Once this setup is complete, users can proceed through the installation process to have a working instance of their chosen OS.
Enabling Remote Desktop Access
To facilitate remote desktop access, install XRDP, an open-source tool that employs the Remote Desktop Protocol. Begin by updating Ubuntu with the command:
sudo apt update && sudo apt upgrade -y
Next, install XRDP and the XFCE desktop environment using the following command:
sudo apt install xrdp xfce4 xfce4-goodies -y
After installation, configure the session by entering:
echo xfce4-session > ~/.xsession
sudo systemctl enable xrdp
sudo systemctl start xrdp
With XRDP set up, adjust the networking settings in VirtualBox. Shut down the VM, select it, and navigate to Settings > Network. Configure Adapter 1 to NAT and enable port forwarding. Set the protocol to TCP, with both the Host Port and Guest Port assigned to 3389.
Once configured, users can download an app such as Microsoft Remote Desktop (now titled Windows App on macOS). By entering the host machine’s IP address and the designated port, remote access to the VM becomes possible, provided both devices are connected to the same network.
For users traveling away from their home network, additional steps are necessary. Access the router’s settings and locate the Port Forwarding option. Create a rule with both External and Internal Ports set to 3389, using TCP as the protocol and inputting the host’s IP address. This configuration allows for remote access by entering the public IP address of the host machine along with the port number in the remote desktop application.
Concerns surrounding the resource consumption of VMs often lead to hesitation among users. Traditional VMs can indeed be resource-intensive, resulting in lag and reduced performance. By hosting a remote desktop inside a VM, users mitigate these issues, as the VM operates independently on a more capable system. This setup not only facilitates efficient work but also enhances the overall user experience, ensuring that resource allocation does not impede performance.
As the demand for flexible work solutions continues to rise, self-hosted remote desktops provide an effective strategy for professionals aiming to maintain access to essential tools and operating systems while on the go. With a bit of technical setup, users can enjoy a seamless and powerful remote working experience.