
chroot를 설치한 후 x11에 연결하는 데 문제가 있습니다. 이것이 일반적인 사용 사례라고 생각했지만 이 사용 사례에 대한 특정 정보를 찾을 수 없습니다.
# debootstrap stable /srv/stable/
...
# chroot /srv/stable/ xeyes
No protocol specified
Error: Can't open display: :0
답변1
첫째, x11 클라이언트는 일반적으로 소켓 파일을 통해 x11 서버와 통신해야 합니다.
/tmp/.X11-unix/X0
# mount -o bind /tmp/ /srv/stable/tmp/
둘째, 계속해서 혼란을 겪고 있다는 뜻입니다 .xauth
xhost
A. (권장) chroot에 있는 프로세스의 uid는 호스트의 xauthority가 있는 사용자의 uid와 일치해야 합니다. 예를 들어 호스트 사용자의 사용자 이름/그룹 이름 userid/groupid를 chroot(보통 uid/gid)에 복제할 수 있습니다. 1000/1000)
# chroot /srv/stable groupadd -g $(id -g) $(id -gn) # chroot /srv/stable useradd -u $(id -u) -g $(id -g) $(id -un)
.
또는 B, chroot에 있는 프로세스의 uid는 xauthority 파일과 같은 다른 방법으로 인증되어야 합니다. chroot는 chroot 내부에서 uid 0으로 실행되므로 다음과 같이 chroot 외부에서 uid 0을 인증할 수 있습니다.
# xhost +si:localhost:root localhost:root being added to access control list
이제 그래픽 프로그램에 x11 모니터를 사용할 수 있는 연결 및 권한이 있어야 합니다.
# chroot /srv/stable sudo -u $(id -un) xeyes
# chroot /srv/stable xeyes