To run Google Chrome without a sandbox on Ubuntu 20.04 WSL, you can't use the --no-sandbox flag with Google Chrome within WSL as it won't run. Instead, you can use a workaround by setting up a Linux environment in a virtual machine (VM) and then installing Google Chrome in that VM. Here's a step-by-step guide to help you achieve this:
-
Install VirtualBox:
Open a terminal and run the following command to install VirtualBox:
sudo apt-get update sudo apt-get install virtualbox virtualbox-ext-pack -
Create a new VM:
Launch VirtualBox and click on "New" to create a new virtual machine. Choose "Linux" as the type and "Ubuntu (64-bit)" as the version. Name the VM and set the memory size according to your preference.
-
Configure the VM settings:
After creating the VM, click on "Settings" and then go to "Storage" -> "Controller: SATA" -> "Add Hard Disk". Choose "VDI" as the disk type and "Dynamically allocated" as the storage on physical hard drive. Set the size according to your preference.
-
Install the operating system:
Click on the green arrow to start the VM. Choose "Create a new virtual disk" when asked about the installation media. Once the VM boots up, follow the Ubuntu installation process.
-
Share the WSL folder:
After installing Ubuntu, you can share the WSL folder with the VM. In the VM, open a terminal and run the following command:
sudo apt-get install ppa:vboxfs-dev/vboxfs sudo vboxmanage mount vboxsharedThen, go to the WSL terminal and run the following command to share the folder:
wsl --shared-folder <folder_name> <folder_name>Replace
<folder_name>with the name of the folder you want to share. -
Install Google Chrome:
In the VM, open a terminal and run the following commands to update the package lists and install Google Chrome:
sudo apt-get update wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo dpkg -i google-chrome-stable_current_amd64.deb -
Run Google Chrome:
You can now run Google Chrome from the VM by typing
google-chromein the terminal.
By following these steps, you'll have Google Chrome running on a Linux VM without a sandbox, and you can access it from the WSL terminal by sharing the folder between the VM and WSL.