On Ubuntu server 11.10 I am trying to install a virtual machine using virt-manager. I believe that I have everything right, but when I go and run the command virt-manager I get the following error message:
File "/usr/share/virt-manager/virt-manager.py", line 383, in <module> main()
File "/usr/share/virt-manager/virt-manager.py", line 285, in main raise RuntimeError(_("Unable to initialize GTK: %s") % gtk_error)
RuntimeError: Unable to initialize GTK: could not open displayI want to use virt-manager so that I can quickly and efficiently create multiple (6) virtual machines, but is there any other alternative that does not take hours per host system, and is still lightweight?
My machine is as follows:
- Ubuntu Server 11.10
- 8 cores @ 2.5ghz
- 64 gb ram
- Packages:
qemu-kvmlibvirt-binvirt-managerbridge-utilsgnome-core
3 Answers
Are you running X on the server ? If not, you can run it from a second machine over ssh
ssh -X user@serverOr you can run a light weight X session on the server, run a web interface (convirt or similar), or run virsh (command line interface).
2Have an ubuntu laptop/desktop in the same network as your server. Install virt-manager on it. Use:virt-manager -c qemu+ssh://root@your-server-ip-or-name/system as command.
Alternatively, read on at
Sorry to revive this old question, but I've encountered the same problem trying to run virt-manager via ssh+X11 with Putty from a Windows client machine.
For me, the following steps solved the problem:
- Have xauth and xterm installed on the server
- Have XMing running on the windows (client) machine
- Run Putty with X11 forwarding (on client, connecting to server)
- Log in as root, or other privileged user (using Putty from client)
- Execute virt-manager on the server. It should bring up a separate dialog in Xming on the client showing virt-manager
So I think you were missing the X server on Windows, which is what Xming is providing.