I know it’s not directly Debian, but…
I’m currently running a Zorin 17 x86_64 vm (in virtualbox, windows 11 host), which uses wayland.
In it i have a Debian 9 stretch aarch64 chroot, which comes with X.
I’d like to test the GUI app i compiled in that chroot, how is that feasible?
For reference, this is how i setup initially:
$ sudo apt install debootstrap qemu-user-static
$ sudo mkdir -p /opt/deb9/sysroot && sudo chown -R myuser:myuser /opt/deb9
$ sudo /usr/sbin/debootstrap --arch=arm64 --foreign --variant=minbase stretch /opt/deb9/sysroot http://archive.debian.org/debian-archive/debian/
$ sudo cp /usr/bin/qemu-aarch64-static /opt/deb9/sysroot/usr/bin/
$ sudo chroot /opt/deb9/sysroot qemu-aarch64-static /bin/bash
# /debootstrap/debootstrap --second-stage
# echo 'APT::Install-Recommends "0";' >> /etc/apt/apt.conf.d/99noExtras
# echo 'APT::Install-Suggests "0";' >> /etc/apt/apt.conf.d/99noExtras
# echo 'deb http://archive.debian.org/debian-archive/debian/ stretch main contrib' > /etc/apt/sources.list
# echo 'deb-src http://archive.debian.org/debian-archive/debian/ stretch main contrib' >> /etc/apt/sources.list
# uname -nm | sed -e 's/ /-/' > /etc/debian_chroot
# apt update
# apt install -y g++ make cmake automake autoconf libtool git vim pax-utils tree
# adduser myuser
$ su myuser
> do stuff
Network isn’t really configured so any git push or similar is done outside the chroot.
Edit: turns out i needed Debian 11 instead and it was a matter of mapping a lot of env onto the chroot, creating necessary dirs and rbinding.
Script to chroot:
#!/usr/bin/env bash
sudo mount --rbind /proc ${SYSROOT}/proc/
sudo mount --rbind /sys ${SYSROOT}/sys/
sudo mount --rbind /dev ${SYSROOT}/dev/
sudo mount --rbind /run/systemd/resolve ${SYSROOT}/run/systemd/resolve
sudo mount --rbind /run/user/1000 ${SYSROOT}/run/user/1000
sudo mount --rbind /run/mysqld ${SYSROOT}/run/mysqld
sudo mount --rbind /etc/xdg ${SYSROOT}/etc/xdg
sudo chroot ${SYSROOT} qemu-aarch64-static /bin/bash
exit 0
The caveats being MariaDB runs on the host and user 1000 isn’t a portable solution.
~/.bashrc
of the chrooted user:
export XDG_SESSION_DESKTOP=zorin
export XDG_SESSION_TYPE=wayland
export XDG_CURRENT_DESKTOP=zorin:GNOME
export XDG_SESSION_CLASS=user
export XDG_RUNTIME_DIR=/run/user/1000
export XDG_CONFIG_DIRS=/etc/xdg
export XAUTHORITY=$(ls -a /run/user/1000/.mutter*)
export WAYLAND_DISPLAY=wayland-0
Sure, don’t run X in the chroot, instead bind the socket for XWayland inside the chroot.
As long as the socket is available, and the environment variables are set, the app will be none the wiser.
If you want run your app in Wayland, you could use waypipe. Similarly you’ll want to bind the socket into the chroot.
@0x0 why would anyone use a deprecated, outdated and unsupported version of Debian?
Perhaps to support a customer’s specific hardware.