executable_chroot-games.sh 622 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. image='/tmp/games'
  3. qcow="$HOME/vm/games.qcow2"
  4. sudo modprobe nbd
  5. mkdir -p "$image"
  6. sudo qemu-nbd -c /dev/nbd0 "$qcow"
  7. sudo vgscan
  8. sudo vgchange -ay
  9. sudo mount /dev/debian-vg/root "$image"
  10. sudo mount --bind /dev "$image/dev"
  11. sudo mount --bind /dev/pts "$image/dev/pts"
  12. sudo mount --bind /dev/shm "$image/dev/shm"
  13. sudo mount --bind /srv/share "$image/mnt"
  14. sudo mount --bind /tmp "$image/tmp"
  15. sudo mount --bind /run/user/1000 "$image/var/run/user/1000"
  16. sudo mount -t proc none "$image/proc"
  17. sudo mount -t sysfs sys "$image/sys"
  18. xhost +local:
  19. sudo chroot "$image" /bin/bash
  20. # source /etc/profile
  21. # su - natsu