Skip to content

Setting up the environment on Linux distributions other than Ubuntu 20.04

Filip Parag edited this page Nov 27, 2021 · 1 revision

If you are already running a Linux-based system with kernel 5.4 or newer, and X11 display server, by following this guide, you can set up an isolated Ubuntu 20.04 workspace for this project.

System preparation

With support for dual boot (easier)

  1. Create an empty partiton on your disk with at least 20GiB of space (eg. /dev/sda3)
  2. Install Ubuntu 20.04 to the empty partition

Without support for dual boot (more flexible)

  1. Create an empty directory (eg. ~/ubuntu)
  2. Install Ubuntu 20.04 system files using debootstrap:

Connecting two systems

  1. Create a script file (eg ~/ubuntu.sh) with the following content:
#!/bin/sh

# Remove this line if using second option in previous step (without dual boot)
mount "$1" /mnt

mount -t proc none /mnt/proc
mount -o bind /dev /mnt/dev
mount -t devpts none /mnt/dev/pts
mount -o bind /sys /mnt/sys
mount --bind /etc/resolv.conf /mnt/etc/resolv.conf
mount -o bind /tmp /mnt/tmp
mount --bind "/home/$2" "/mnt/home/$2/Documents"
cp -p "/home/$2/.Xauthority" "/mnt/home/$2"
chmod 1777 /mnt/dev/shm

# Check the value of your DISPLAY variable using command: echo "$DISPLAY"
export DISPLAY=":0.0"

chroot /mnt /usr/bin/env su "$2"
  1. Make the script executable
chmod +x ~/ubuntu.sh

Entering the workspace

  1. To enter the workspace, run this only once after every reboot:
sudo ~/ubuntu.sh ~/ubuntu
  1. For every terminal window after that, run this instead:
DISPLAY=":0.0" sudo chroot ~/ubuntu /usr/bin/env su "$USER"