Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 9920  / 3 Years ago, mon, october 25, 2021, 3:02:41

Description:



I'm using a Lubuntu 13.10 X86-64 livecd to chroot into another Lubuntu 13.10 X86-64 located on my hard drive in a folder called chroot. I've had no trouble using the terminal to chroot in, and I can launch gui applications on my current xserver from the chroot after using "xhost +" on the livecd, but I need provide the chroot it's own X output. I've googled, searched askubuntu, and typed every command under the sun and moon all to no avail. I would love a solution, but would even be happy for a guess if you've got one. I've backed up the chroot so I can restore if it gets messed up. I've also tried using Xnest but it doesn't want to work either. I would like to run the lxde desktop environment in the chroot, if possible logging in as a specific user.



Details:



Below are the commands I used to commence the chroot.



sudo mount --bind /dev /media/lubuntu/os/chroot/dev

sudo mount --bind /proc /media/lubuntu/os/chroot/proc

sudo mount --bind /sys /media/lubuntu/os/chroot/sys

sudo cp /etc/resolv.conf /media/lubuntu/os/chroot/etc/resolv.conf

xhost +

sudo chroot /media/lubuntu/os/chroot


I would also have typed "export DISPLAY=:0.0" in the chroot, but it worked without it.



Test Results:



Test #1:



Description:



I get a black screen on all outputs (control+alt+Fkeys), and I cannot type anything. I'm forced to kill the computer by hand.



Details:



In chroot terminal type



export DISPLAY=localhost:1


In chroot terminal type



startx -- :1


Test #2:



Description:



I get a black screen for F1, pressing "control + alt + F7" gets me back to my normal desktop. I cannot type anything on the black screen. When I enter "gksu leafpad" in the chroot terminal on F7 I get an error that it "cannot open display localhost:1". When I switch to F1 it now shows a terminal prompt for the livecd not the chroot.



Details:



In chroot terminal type



export DISPLAY=localhost:1


In livecd terminal type



sudo startx -- :1


Test #3: [Edited In]



Description:



I get a blank black window, just as I would for Xnest. When I try to launch xterm I get an error stating "could not resolve hostname lubuntu: Name or service not known". I've also tried installing "openssh-server" in the chroot, and on the livecd. When I use the same commands on the livecd only and attempt to launch xterm from the livecd I do not get the same error. Instead I get a password prompt. The livecd user "lubuntu" has no password. If I leave the password blank I get error "permission denied. If I create a user account a retry it I get error "permission denied, please try again" when entering the correct user password. The "could not resolve hostname lubuntu" error experienced with the chroot also occurs when using apt-get in the chroot, though I can and have installed things from apt.



Details:



In livecd terminal type



Xephyr -ac -screen 1024x768 -br -reset -terminate 2> /dev/null :1 &


In chroot terminal type



DISPLAY=:1.0


I also tried "DISPLAY=:1.0" in the livecd terminal.



In chroot terminal type



ssh -XfC -c blowfish root@lubuntu xterm


I also tried "user@server" and "root@localhost" in the chroot terminal.



Additional Information



Anything else you want to know? I'll try to add it here.


More From » 13.10

 Answers
1

Use Xephyr



sudo apt-get install xserver-xephyr


Start Xephyr



Xephyr -ac -screen 1280x1024 -br -reset -terminate 2> /dev/null :1 &


The ":1" = your display (displays are numbered starting with 0)



-ac = disable access control restrictions= allow you to forward X



-screen 1280x1024 = screen size



-br = black background



-reset -terminate= Xephyr should automatically close when the last X client is killed, does not always work.



2> /dev/null redirects error messages.



Set your display (for X)



DISPLAY=:1.0


ssh into your chroot (you may need to install ssh server, you may also wish to look at LXC )



ssh -XfC -c blowfish user@server xterm


or use any other graphical tool you wish.



See also



http://ubuntuforums.org/showthread.php?t=620003



https://help.ubuntu.com/lts/serverguide/lxc.html


[#26460] Tuesday, October 26, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
byishted

Total Points: 469
Total Questions: 113
Total Answers: 113

Location: Tajikistan
Member since Sun, Aug 29, 2021
3 Years ago
;