This guide explains the steps to set up and connect XLaunch, a Virtual Machine (VM) running Linux Mint, and VS Code for a seamless development environment. If you are running Windows and want to have a linux envirornment for development this guide will help.
- VS Code: Download here
- Remote - SSH Extension: Install it from the VS Code marketplace
- Oracle VirtualBox: Download here
- XLaunch: Download here
- Install VirtualBox and create a virtual machine (VM).
- Install Linux Mint or Ubuntu inside the VM.
- Download Here:
- Linux Mint OR
- Ubuntu
- Configure VM network settings:
- Go to
Settings
→Network
- Enable Adapter 2 and select NAT
- Enable Adapter 3 and select Host-Only Adapter In the second option choose VirtualBox Ethernet Adapter
- Go to
- Go to
Settings
→Display
- Enable the 3D Acceleration checkbox
- Ubuntu or Linux Mint
- sudo privileges
- Internet connection
- Save the script as
vm_dev_setup.sh
or clone this repository and run the script - Make it executable:
chmod +x vm_dev_setup.sh
- Run with
sudo
:sudo ./vm_dev_setup.sh
- What the Script Does
- Checks and installs system prerequisites
- Configures SSH
- Sets up network interfaces
- Configures X11 Forwarding
- Enables firewall
- Installs development tools
- Open VS Code and install the Remote - SSH extension.
- Click the Remote SSH icon and add a new host:
hostname@192.168.56.xxx
hostname
= Your system's hostname, x = number of your system's IP Address.- Enter your Linux Mint login credentials when prompted.
- After successful connection you should see $ sign, In Vscode use: Ctrl + ` and select terminal to see the $ sign
- Install XLaunch on your host machine.
- Run XLaunch and select the following options:
Next
→Next
→ Disable Access Control (check this box) →Finish
- In Vscode terminal write following script to setup XDISPLAY.
export DISPLAY=192.168.56.1:0.0
- Verify the setup by running:
$ xeyes
- A pair of animated eyes should appear, confirming the connection.
-
Use
ifconfig
to seeNETWORK_INTERFACE_NAME
IPv4 address will be visible under this -
Write this command, example: $
dhclient -v enp0s8
or $dhclient -v NETWORK_INTERFACE_NAME
- Reopen XLaunch and Disabling access control (Reffer 5. Setting up XLaunch Step 2:)
- Write this command
export DISPLAY=192.168.56.1:0.0
and usexeyes
to verify the Setup Do not (delete / kill) this (terminal / process) if this happens in the new terminal rewrite the command:export DISPLAY=192.168.56.1:0.0
else XDISPLAY won't work
All IP Address and Port Numbers in this guide are used as an example and should not be treated as your system's IP Address / NETWORK_INTERFACE_NAME
- Ensure the SSH service is running inside the VM:
$ service ssh start
- Verify the network port and IP address:
$ ifconfig
- If network is not configured, use:
enp0s9
is given as an example, in your system this might be diffrent useifconfig
from previous step to know the NETWORK_INTERFACE_NAME nameWhen used$ dhclient -v enp0s9
ifconfig
IPv4 Adress will be visible Ex:192.168.56.103
under NETWORK_INTERFACE_NAMEenp0s8
during network configuration usingdhclient
thisenp0s8
NETWORK_INTERFACE_NAME should be selected, if used different NETWORK_INTERFACE_NAME configuration will fail and ssh connection will fail
- Confirm that 3D acceleration is enabled in the VM settings.
- Check if XLaunch is running on your host machine.
- Ensure Disable Access Control is checked in XLaunch settings.
- Add screenshots of the setup process (e.g., network settings, SSH configuration, and XLaunch test).
- Official documentation:
- Always ensure your software is up to date.
- Take care when modifying system settings.
- Backup your VM and important data before making significant changes.
- Restart services if you encounter unexpected issues.
- Double-check network configurations.
- Verify firewall settings may be blocking connections.
- If you encounter error while installing virtualbox
Example: Missing Dependencies Python Core / win32api make sure to install python, If Python is installed use
pip install pywin32
- If you encounter Microsoft Visual C++ 2019 Redistributable Error, Install the package from here - Microsoft Visual C++ 2019 Redistributable
Contributions and improvements to this guide are welcome! Please open an issue or submit a pull request.