50

It is common that programmers will need to interface with virtual-machines in their day-to-day workflows, and one popular way of doing so on Linux and Windows systems is with virt-manager.

Is their a way to get virt-manager or a similar alternative running on a MacOS machine?

Adam E.
  • 48
  • 1
  • 8
Happynoff
  • 1,365
  • 1
  • 14
  • 28
  • 2
    This question seems off-topic on stackoverflow, should be moved to a different site of the stackexchange network like askdifferent. – anddam Nov 07 '15 at 10:46
  • instead of voting for the closure consider to relocate the question and all helpful answers to the appropriate site - will be way more helpful for everyone – Oleg Kokorin Oct 30 '19 at 14:44

4 Answers4

65

There's now a brew formula homebrew-virt-manager which I've used to successfully connect to a CentOS 5 box running qemu+kvm.

brew tap jeffreywildman/homebrew-virt-manager
brew install virt-manager virt-viewer
sudo ln -s /usr/bin/python /usr/bin/python2
virt-manager -c qemu+ssh://user@libvirthost/system?socket=/var/run/libvirt/libvirt-sock
Andrew Mackrodt
  • 1,806
  • 14
  • 10
  • Thanks, just what I was looking for! – Andrew Aug 08 '15 at 08:28
  • 2
    Small question: how do I find out what my qemu+ssh connection string is? What user/socket should I use? – Rogier Lommers Sep 20 '15 at 09:28
  • I followed your steps and I cannot pass the third step. $ sudo ln -s /usr/bin/python /usr/bin/python2 Password: ln: /usr/bin/python2: Operation not permitted Then I have problem in step four. $ virt-manager -c qemu+ssh://user@debianserver/system?socket=/var/run/libvirt/libvirt-sock --no-fork env: python2: No such file or directory – hatted Oct 28 '15 at 07:41
  • @hatted: If you're running OS X El Capitan, this is because of the new "System Integrity Protection" feature which prevents modification of the System folder outside of Installer or Software Update. One way to fix is by adding an alias in your shell rc instead of creating a symlink. `alias python2=/usr/bin/python` – Scott Odle Feb 11 '16 at 17:51
  • I needed to copy my ssh key to `libvirthost` for this to work. – Rick Smith Mar 23 '16 at 19:52
  • Doesn't work on macOS Sierra :/ – Angel Velásquez Oct 05 '16 at 06:32
  • @AngelVelásquez see workarounds here: https://github.com/jeffreywildman/homebrew-virt-manager/issues/58 – pgb Oct 19 '16 at 14:20
  • Installing seems to work (without errors) on Sierra, but Python crashes while using libgdk plugin. :( – Wouter Schut Dec 03 '16 at 15:53
  • it works on my Mojave mac, ignoring the ln -s step. Can connect to a Ubuntu box. – Enric Mieza Jul 03 '19 at 07:29
22

sadly no, you can however install virt-manager on a linux box and run it on your mac desktop through vnc and X11.

what you need to do is start X11, open xterm (command + N), type ssh -X user@linux-box, then type virt-manager once logged on.

rye
  • 253
  • 2
  • 2
  • 3
    extra requirement for Mountain Lion onwards: you will need to run XQuartz in place of X11 (it's the community X11 started by Apple) – LRE Jan 27 '13 at 03:28
  • 1
    Technically you don't need vnc, just X11 (or XQuartz) – knowncitizen Dec 15 '14 at 20:26
  • True, but X is *much* slower over distances than VNC for interacting with the VMs. I use X for virt-manager and VNC for the VMs. – Sean W. Oct 28 '15 at 01:49
  • You can skip the extra Linux installation altogether and forward X11 over SSH for Virt-Manager http://oroborosx.sourceforge.net/remotex.html -- and also use VNC to connect to the virtual machines by configuring it to access your KVM server's IP address with different ports for each VM (e.g. port 5900 for VM 1, 5901 for VM 2, etc.) – AveryFreeman Dec 19 '17 at 05:35
5

Same problem here, tried several solutions and workarounds, and found that for managing virtual machines on a remote Qemu/KVM server nothing is as reliable and comfortable than a GNU/Linux system running virt-manager.

Our best solution so far is to install Virtualbox in MacOS to run a Lubuntu LTS system with virt-manager.

We found Lubuntu excellent for this purpose: it just works, it's easy to use and requires few resources to run (it can use less than 300 MB of RAM to run virt-manager and 3-4 SPICE clients). You can save this Virtualbox machine state when you don't need it, and restore it in a few seconds when needed.

Moreover, there's irony in running a virtual machine locally to manage remote virtual machines! :-)


Update

Someone prepared a vagrantfile to quickly setup an Ubuntu virtual machine and run virt-manager via ssh. See:

https://st-g.de/2016/08/virt-manager-in-vagrant

Community
  • 1
  • 1
gerlos
  • 490
  • 5
  • 13
3

AFAIK no, but you can use it alright if you do this:

  1. install (in the host) the NoMachine NX server
  2. install the NX client on your mac
  3. login from the mac
  4. fix the keyboard issues following these instructions
  5. open virt-manager in the gnome session in your server/host (that you are using via the NX client)
  6. have fun
Sebastian Sastre
  • 2,034
  • 20
  • 21