38

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.

amenthes
  • 105
  • 6
slm
  • 7,355
  • 16
  • 54
  • 72

9 Answers9

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.

Sven
  • 97,248
  • 13
  • 177
  • 225
  • 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 03 '12 at 09: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.

AndreasT
  • 807
  • 2
  • 10
  • 16
  • 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 05:14
  • Does this has better performance than WSL? – 71GA Mar 28 '22 at 09:33
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

ndemou
  • 1,215
  • 2
  • 16
  • 27
dyasny
  • 18,482
  • 6
  • 48
  • 63
  • 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, http://www.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](http://spice-space.org/home.html). 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
  • 1
    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 05:37
  • 1
    Spice is built into qemu, so currently it can only be used with KVM guests – dyasny Dec 15 '11 at 09:36
4

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>
martin
  • 161
  • 1
  • 7
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.

thistleknot
  • 161
  • 5
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

zaggynl
  • 3
  • 1
aligot
  • 318
  • 1
  • 7
  • 1
    This would have possibly been my choice, except I can't get Bash on LTSB Windows 10. Also, you can't backup Windows 10 Store Apps.. REDICULOUS! https://superuser.com/questions/1295577/backing-up-and-restoring-microsoft-store-apps-windows-10 – FreeSoftwareServers Apr 23 '18 at 07:29
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
Erisa
  • 3
  • 3
FreeSoftwareServers
  • 571
  • 1
  • 6
  • 25
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

slm
  • 7,355
  • 16
  • 54
  • 72
Registered User
  • 1,453
  • 5
  • 18
  • 37
  • 3
    This relies on running virt-manager on a remote host, which is not what is wanted here. – Michael Hampton Dec 27 '12 at 04: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 04: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 04:52
-1

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

Greg
  • 1,557
  • 5
  • 24
  • 35