Installing chromium in ubuntu with GUI we want to run chromium on a vps using XFCE GUI panel and XRDP connection and windows remote desktop.
- Update and Upgrade Your VPS
sudo apt update
sudo apt upgrade -y
- Install XFCE Desktop Environment
sudo apt install xfce4 xfce4-goodies -y
- Install XRDP for remote desktop connection
sudo apt install xrdp -y
- Enable XRDP To ensure XRDP starts automatically on boot
sudo systemctl enable xrdp
Now we need to switch to Xorg as the default display server
- Create an XRDP startup script
sudo nano /etc/xrdp/startwm.sh
- Add the following content to the end of startwm.sh file
#!/bin/sh
if [ -x /etc/X11/xinit/xserverrc ]; then
exec /etc/X11/xinit/xserverrc
fi
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4
- Make the script executable
sudo chmod +x /etc/xrdp/startwm.sh
- Restart XRDP
sudo systemctl restart xrdp
- (optional) Ensure that your VPS firewall (mine was not active) is allowing connections on port 3389 (the default XRDP port)
sudo ufw allow 3389
sudo ufw reload
Now we want to install chromium on the vps When you login form windows remote desktop connection as root user and trying to install chromium, you get an error, because it goes against Chromium's security measures, so we should switch to a regular user. You can add a regular user in putty
- Create a new ordinary username(you could use your preferred username instead of yourusername and replace it in the all following codes instead of yourusername)
useradd yourusername
passwd yourusername
- Add the new user to the sudo group, you should use the new username you created in the previous step instead of yourusername in the all following steps
sudo usermod -aG sudo yourusername
next you should switch to the new user, but before that you should do the following
- Create a home directory for the new user
sudo mkdir /home/yourusername
- Set the correct ownership and permissions
sudo chown yourusername:yourusername /home/yourusername
sudo chmod 700 /home/yourusername
- Switch to the new user
su - yourusername
- Install Chromium
sudo apt install chromium-browser -y
Now connect using windows remote desktop connection and your new user name credentials 7. Open terminal in the graphical interface and run Chromium
chromium-browser
Also you could run chromium using application in the upper left of the screen and in the internet you could find chromium