37

We've been using KVM for almost a year strictly on CentOS 5.x as the KVM host, with Fedora and Ubuntu workstations accessing the KVM host and its guests using virt-manager, virt-viewer, and ssh.

Is anyone aware of a way to access the KVM host using virt-manager from a Windows workstation? We have one co-worker who would like to access the KVM host, from a Win7 system.

EDIT #1

I'm familiar with running a X11 server on windows such as Xming, and remote displaying virt-manager from the KVM host to a windows workstation, but what I'd really like here is to know of any solutions native to windows, i.e. is there a version of virt-manager that'll run on windows.

EDIT #2

Still no progress on this myself wrt. a native virt-manager client. I did come across a compiled version of libvirtd for windows along with a discussion on a mailing list about how to get libvirtd working on windows. I'm adding the links to this question in the hopes that someone will figure out how to get virt-manager working.

EDIT #3

Finally some progress. Came across this project on github called msys_setup which includes a windows port of virt-manager. It's partially functional, doesn't support qem+ssh:// connection type so it's still not usable for our needs, but it's a start.

0
11

Use putty and some X Server software on the Windows side (e.g. Xming) and use X11 tunneling with putty to display the remote virt-manager console.

1
  • 1
    I am using the same approach currently. But the problem is any special keys (like winkey or other windows-wide keyboard shortcuts that I have configured) are grabbed by host windows, instead of the virt-manager window. – anishsane Dec 3 '12 at 9:34
10

I would use Cygwin. Then you can install virt-manager and openssh and place a shortcut on the Desktop. It is native.

Cygwin provides the linux tools and facilities around programs so that it feels like a linux environment. For instance, virt-manager can call ssh to make the connection to your KVM Server and would be able to run virsh and send commands to it. It also provides an X-Server. Which is all natively compiled.

Update: Thanks Yaakov's comment: There is now a directly installable package in cygwin for virt-manager. The actions below are not necessary anymore.

If you have the time: You can easily customize the cygwin installation to exactly fit your needs. Just go through the folders, throw everything out you don't need. Write a script that starts the X Server and then virt-manager, zip it up and ey presto! there's your virt-manager for Windows.

2
  • I've used cygwin in the past and though this would work is a little too heavy handed a solution for what I was looking for. AS I said in the question, I'm looking for a native client for windows to virt-manager. – slm Nov 23 '12 at 14:45
  • 2
    Cygwin now includes a virt-manager package as well. – Yaakov Jun 27 '17 at 5:14
5

I would simply use ssh (putty) and virsh, and a VNC/Spice client (like virt-viewer for Windows), if I were confined to a Windows workstation

5
  • I'm not that familiar with Spice. Can you explain what Spice is and is there a Spice client available for windows? I found this link, linux-kvm.org/page/SPICE, which shows how to set it up, but it doesn't really explain the benefits of Spice vs. VNC. – slm Dec 14 '11 at 18:40
  • I also found this link to the Spice Project. Still don't quite entirely grasp exactly where it fits. I think that it provides a native graphics driver for the guests, but that's as far as I've gotten in my understanding. – slm Dec 14 '11 at 18:59
  • Spice performs better and delivers a much better (actually, at the level of a normal, non-3D video card, meaning you can watch movies and youtube flicks, play non-3D games etc.) performance than VNC. Clients are available from several platforms. You have to start the VM with Spice support and install a Spice driver in the VM of course. At the moment, RHEL5 and higher and Fedora 14 and higher both have native support for Spice – dyasny Dec 14 '11 at 20:12
  • Curious, can the Spice driver be used for the KVM host itself or is it limited to KVM guests only? – slm Dec 15 '11 at 5:37
  • Spice is built into qemu, so currently it can only be used with KVM guests – dyasny Dec 15 '11 at 9:36
3

Yes. There is virt-viewer for Windows

http://virt-manager.org/download/sources/virt-viewer/

Update:

I see you were asking about virt-manager on windows and not virt-viewer.

1
  • +1 I was trying to use virt-viewer as virt-manager lol, thanks for saving me the time! It isn't clear on the website that its not the manager. – FreeSoftwareServers Feb 7 '18 at 4:37
3

You could use Bash on Ubuntu on Windows ( https://msdn.microsoft.com/en-us/commandline/wsl/about ).

Then, you are able to install virt-manager as on Ubuntu:

$ apt-get install virt-manager

Then you'll need a X server. You can install Xming.

You'll need to add DISPLAY=:0.0 to your environment. To do that, add export DISPLAY=':0.0' to ~/.bashrc and restart your terminal.

You may want to enable a ssh agent:

eval `ssh-agent` ; ssh-add

After that, you should be able to run virt-manager as you'll do on Linux. There are some bugs but it works :-).

edit by a z:
d-bus error? Per: https://www.reddit.com/r/Windows10/comments/4rsmzp/bash_on_windows_getting_dbus_and_x_server_working/
Run: sudo sed -i 's$<listen>.*</listen>$<listen>tcp:host=localhost,port=0</listen>$' /etc/dbus-1/session.conf

close/open bash, try again, use virt-manager --debug for more info

1
3

Here is a up-to-date instruction set performed by me today and saved here for my future reference:

  1. Install wsl and ubuntu 18.04 LTS
  2. Install XMing
  3. Start Ubuntu 18.04 LTS and run sudo apt update && sudo apt upgrade
  4. Install dbus-x11 and virt-manager: sudo apt install dbus-x11 virt-manager
  5. (optional) If you need ssh
    1. Install ssh-askpass: sudo apt install ssh-askpass and
    2. Generate a new ssh key, if you have not done so: ssh-keygen
    3. Copy the key to your servers: ssh-copy-id user@server
  6. Start Xming
  7. run virt-manager

The first error is not a problem, just add a new connection and remove the local connection and you are up and running. If your connections are not saved between starts of the virt-manager, you need to perform the dbus session.conf trick:

Edit the configuration file: sudoedit /etc/dbus-1/session.conf and edit the first line or add the line such that the file contains:

 <listen>tcp:host=localhost,port=0</listen>
1

Adding a "HowTo" on AndreasT Answer as it is the "best option" IMO ATM. Although using Bash + Windows Subsystem for Linux might be another option, it was unavailable on Windows 10 LTSB and I really hate how I can't backup Windows 10 Store Apps, so it would need to be re-configured/install each time Windows was deployed.

I posted a YouTube Video here >> https://www.youtube.com/watch?v=gDEAu3oPcR0

And I wrote up my own blog post, but I know better than to leave out the details in a URL so I will copy the short form here. (https://www.freesoftwareservers.com/wiki/running-virt-manager-inside-windows-10-using-cygwin-with-shortcut-on-desktop-28016650.html)

  • Install Cygwin w/ virt-manager, xinit and openssh.
  • Configure passwordless SSH via RSA Key to KVM Host.
  • Configure XWin to autostart Virt-Manager.

    cat << 'EOF' > ~/.startxwinrc
    export DISPLAY=:0.0
    virt-manager
    sleep inf
    EOF
    chmod +x ~/.startxwinrc
    

Create shortcut on Desktop: Virt-Manager.cmd
This is the contents of mine:

tskill.exe xwin

C:\cygwin64\bin\run.exe /usr/bin/bash.exe -l -c /usr/bin/startxwin
0

virt-manager is now available natively on Windows: https://virt-manager.org/download/

1
  • It looks like only virt-viewer for Windows is available at that URL. – RyanTM Feb 18 at 16:55
0

Please consider using XMing

here is a snapshot of running SSH with X11 forwarding on Xming and virt-manager working on windows (X11 forwarded)

snapshot of virt-manager with x11 forwarding on xming

References

3
  • 3
    This relies on running virt-manager on a remote host, which is not what is wanted here. – Michael Hampton Dec 27 '12 at 4:46
  • hmmm in that case a straight answer to the question OP asks is a no because I have not encountered any solution which would run a virt-manager on a Windows 7 machine other than the X11 forwarding techniques available to us – Registered User Dec 27 '12 at 4:48
  • Read my "EDITS" in the question. I mentioned a couple of leads that looked promising wrt. to running virt-manager on windows. It is working, just not for our scenario as of yet. – slm Dec 27 '12 at 4:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.