- What the environment like:
Local host is Ubuntu 18.04, remote host is Debian 9. There are some virtual machin on remote host. - What I found:
Today I want to management virtual machines on remote host, by usingssh -x
as usual. But this time I logon, it notexhost: unable to open display ""
. And when I executevirt-manager
, it shows like this:
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
(virt-manager:16045): Gtk-WARNING **: cannot open display:
- What I tried to solve this problen:
First I checked my local host's
/etc/ssh/ssh_config
and make sure it have configured like below:
ForwardAgent yes
ForwardX11 yes
ForwardX11Trusted yes
And then check the remote host's /etc/ssh/ssh_config
and make sure it have configured like below:
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
And then I execute virt-manager
, it still shows like below:
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
(virt-manager:16045): Gtk-WARNING **: cannot open display:
Then I tried few commands like below, it seemes useless.
$ sudo vncserver
New 'My_Local_Host:15 (root)' desktop at :15 on machine My_Local_Host
Starting applications specified in /etc/X11/Xvnc-session
Log file is /root/.vnc/My_Local_Host:15.log
Use xtigervncviewer -SecurityTypes VncAuth -passwd /root/.vnc/passwd :15 to connect to the VNC server.
$ export DISPLAY=localhost:15
$ xhost +
xhost: unable to open display "localhost:15"
Finally I installed gksu
and tried to open virt-manager
by it, but it still useless:
gksu virt-manager
(gksu:17242): Gtk-WARNING **: cannot open display: localhost:15
Can you give me some advice? Thank you!
0 Answers