Skip to content

Instantly share code, notes, and snippets.

@rjaeckel
Last active August 29, 2015 14:05
Show Gist options
  • Save rjaeckel/43f6f27a15968f94fca7 to your computer and use it in GitHub Desktop.
Save rjaeckel/43f6f27a15968f94fca7 to your computer and use it in GitHub Desktop.
chroot +X
#!/bin/bash
# @see: http://wiki.ubuntuusers.de/chroot/Live-CD
# mount partition
mount /dev/sda1 /mnt
# mount boot here if neccessary
# mount system environment
# .X11 is for xserver and resolv.conf for networking
for i in /dev /dev/pts /proc /sys /run /tmp/.X11-unix /etc/resolv.conf; do mount -B $i /mnt$i; done
# allow local x-server-connections as it is not going to be started in chroot:
xhost + local:
# do the chroot
chroot /mnt /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment