(01-20-2025, 04:17 AM)timmypeachstatistic Wrote: I do alot of coding on windows through wsl(ubuntu) and have basic knowledge of the bash shell and I'm trying to improve my coding knowledge and get more experience, but will it really help to dual boot linux or should i just keep using wsl?
Personally, I have never been successful at dual booting any OS, and actually end up using both.
So if you are like me, then you have two options.
- Option 1: Install a GUI on WSL and remote into it.
- Option 2: Install Linux on a virtual machine.
Option 1:
I wrote a bash script do to the work for you.
I got the information from this tutorial you can check out yourself:
WSL2 Ubuntu20.04 GUI + Remote Desktop Connection(RDP).
Save the script with a .sh extension. e.g. setup.sh.
If you have to make the file executable, you can run
"chmod +x YourFileName.sh" on the file from a bash command window.
Run the script with
"./setup.sh" from a bash command window.
Disclaimer: I have done this myself, and it does work. It was just a long while ago, so I dont know if I am missing a step or two.
Code:
#!/bin/bash
# Script to update system, install GUI, configure RDP, and enable necessary services
# Step 1: Update and upgrade the system
echo "Updating and upgrading the OS..."
sudo apt update && sudo apt -y upgrade
# Step 2: Install XFCE4 GUI
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NC='\033[0m'
echo "Installing XFCE4"
echo -e "${RED}IMPORTANT NOTE:${NC} When prompted to select the ${BLUE}sddm${NC} or ${BLUE}display manager${NC}, select the option ${GREEN}lightdm${NC}"
sudo apt-get install -y xfce4 xfce4-goodies
# Step 3: Install xrdp for RDP functionality
echo "Installing xrdp..."
sudo apt-get install -y xrdp
# Step 4: Backup the original xrdp.ini file
echo "Backing up the original xrdp.ini..."
sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak
# Step 5: Change the RDP port from 3389 to 3390
echo "Changing RDP port from 3389 to 3390..."
sudo sed -i 's/3389/3390/g' /etc/xrdp/xrdp.ini
# Step 6: Modify max_bpp and xserverbpp settings to increase color depth
echo "Modifying max_bpp settings to 128..."
sudo sed -i 's/max_bpp=32/#max_bpp=32\nmax_bpp=128/g' /etc/xrdp/xrdp.ini
echo "Modifying xserverbpp settings to 128..."
sudo sed -i 's/xserverbpp=24/#xserverbpp=24\nxserverbpp=128/g' /etc/xrdp/xrdp.ini
# Step 8: Edit the startwm.sh file to use XFCE
echo "Configuring startwm.sh for XFCE..."
sudo sed -i '/test -x \/etc\/X11\/Xsession && exec \/etc\/X11\/Xsession/s/^/#/' /etc/xrdp/startwm.sh
sudo sed -i '/exec \/bin\/sh \/etc\/X11\/Xsession/s/^/#/' /etc/xrdp/startwm.sh
echo "startxfce4" | sudo tee -a /etc/xrdp/startwm.sh
# Step 9: Enable and start necessary services (dbus and xrdp)
echo "Enabling and starting dbus and xrdp services..."
sudo systemctl enable dbus
sudo /etc/init.d/dbus start
sudo /etc/init.d/xrdp start
# Final message
echo "System setup complete. You can now restart your machine, and RDP should be available on port 3390."
Option 2:
You can use a tool, like
Oracle VirtualBox, to install Linux in a virtual environment.
Hope this helps.