[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: using debian debootstrap and chroot to login to other distro on neighbouring partition etc



On Thu, Feb 04, 2016 at 06:05:50PM -0600, Dutch Ingraham wrote:
> I'm not sure debootstrap is what you are looking for here.  If you just 
> want to chroot into your Ubuntu,on the same disk, these are the steps:
> 
> 1. Make a mount point, say /mnt/ubuntu;
> 
> 2. Mount the partition Ubuntu is on, e.g., <mount /dev/sda3 /mnt/ubuntu>;
> 
> 3. Change directory to /mnt/ubuntu;
> 
> 4. <mount -t proc proc proc/>;
> 
> 5. <mount --rbind /sys sys/>;
> 
> 6. <mount --rbind /dev dev/>;
> 
> 7. <mount --rbind /run run/>;
> 
> 8. <cp /etc/resolv.conf etc/resolv.conf>;
> 
> 9. <chroot /mnt/ubuntu /bin/bash>;
> 
> 10. <source /etc/profile>;
> 
> 11. <source ~/.bashrc>;
> 
> 12. <export PS1="(chroot) $PS1"
> 
> Of course, you will need to determine certain things up front and modify for
> your particular needs, i.e., which partition Ubuntu is currently residing on,
> whether you need network access, etc. Some of these commands will need to
> be customized/omitted based upon those needs.

This is good advice, and these steps can be automated with the schroot package.

For any non-trivial operations inside your guest systems, such as
installing packages or running daemons, I can recommend Linux containers
(lxc or libvirt-lxc). They look like a fully booted Linux system, but
have low virtualization overhead because they use the host's kernel,
still they have better isolation from the host system compared to the
chroot solution.

Regards,
Mirko


Reply to: