I have an USB thumb stick with the following partition scheme:sdb  sdb1  -> root partition '/'  sdb2  -> /home partition If I boot from a live CD, or just from my current Ubuntu OS located on my computer's hardware, I am able to chroot this way:mount /dev/sdb1 /mntmount /dev/sdb2 /mnt/homechroot /mnt /bin/bashIn this instance, my prompt is something like [root@archiso]. The thing is I would like to log in my user account which is in /mnt/home/me, but I don't know how to do it? A further goal would be to launch X (and any dektop manager) from this user session. So the questions that I need to be addressed are the following:1) How do I log into my user session once I am chrooted?2) Once I am logged in, would it be possible to start X startx, even if I am initially logged in my computer Ubunu OS, with a gnome session already running?
Login to user's session with chroot
mount;partition;chroot;livecd;startx
Do the chroot, as described in the question,and then do su - fred (or whatever your name is) or exec su - fred.Do chroot /mnt /bin/su - fred,so that the su will be the first thing that runs in the chroot environment.Note that both of the above assumethat your fred user is defined in /mnt/etc/passwd.ORDo chroot --userspec=fred:bedrock --groups=group1,group2 /mnt /bin/bash,to set your user identity from the inception of the chroot.The chroot invocation manual says,The user and group name look-up performed by the --userspec  and --groups options, is done both outside and inside the chroot,  with successful look-ups inside the chroot taking precedence.Consider adding -l (or --login) to tell bash to actas if it had been invoked as a login shell;i.e., to tell it to read /etc/profile and ~/.bash_profile, etc.The question asks,How do I log into my user session once I am chrooted?Quite possibly the literal answer, chroot /mnt /bin/login, would work.If this works, it would be the most like an ordinary login,in that it would ask for a user name and a password.It is (probably) the only answer (of these four, anyway)that would cause the who command in the chroot environmentto report your user name (and time of login, etc.) and might be the best betto use some of the more esoteric features of the environment.(Im thinking [speculating] about cron /crontab / at,the passwd command, file system quotas, the accounting system, etc.I dont know whether or why these, or any other software,might not be satisfied with just looking at your real UID.)Of course this, like the first two answers,would operate on users and passwords defined in the chrooted environment.This might not work. I vaguely seem to recall something about some versions of logindetecting that it is being run in a non-standard way (like this)and refusing to play along. But Icant recall specificsand Icant find anything in two minutes worth of searching.