Most articles/videos for virt-manager on OSX connecting to Unraid seemed a bit dated so thought I'd share what I did to get things running. What's outlined below seems like a lot but once you've done it once it can be repeated in under 5 minutes.
My requirements:
- Create, start and stop VM's on Unraid from OSX
- Create + manage snapshots on Unraid from OSX
- Clone VM's on Unraid from OSX
- Monitor basic stats like cpu/ram/network usage
Guide:
##########
## Unraid
##########
1. Setup libvirt + qemu to listen on "0.0.0.0"
A lot of articles referred to editing "/etc/libvirt/libvirtd.conf" but this didn't exist in "/etc/libvirt/". Restarting VM service + array fixed it for me.
a) Restart VM service + array
Settings -> VM Manager -> Set "Enable VM's" to No
Main - Stop Array
Main -> Start Array
Settings -> VM Manager -> Set "Enable VM's" to Yes
b) SSH to Unraid server and change two files:
/etc/libvirt/libvirtd.conf
listen_addr = "0.0.0.0" <-- default is "127.0.0.1"
/etc/libvirt/qemu.con
vnc_listen = "0.0.0.0" <-- default is "127.0.0.1"
c) Again, restart VM service and array (doing both is likely redundant)
Settings -> VM Manager -> Set "Enable VM's" to No
Main - Stop Array
Main -> Start Array
Settings -> VM Manager -> Set "Enable VM's" to Yes
##########
## OSX
##########
1. Install virt-manager on OSX
a) Prerequisites:
Install Homebrew @ https://brew.sh
b) Install virt-manger + dependencies:
brew cask install xquartz
brew tap jeffreywildman/homebrew-virt-manager
brew install virt-manager virt-viewer
mkdir -p /usr/local/Cellar/libosinfo/1.7.1/share/libosinfo
cd /usr/local/Cellar/libosinfo/1.7.1/share/libosinfo/
curl http://www.linux-usb.org/usb.ids -O
curl https://pci-ids.ucw.cz/v2.2/pci.ids -O
2. Create virt-manager app instead of launching via Terminal
Why? There are tools such as "appify" that will wrap a shell script and create pseudo OSX App but it will still launch a Terminal window in addition to virt-manager. I wanted virt-manager to launch like a native OSX app.
a) Create virt-manager app via Automator
Applications -> Automator -> New Document -> Workflow -> Choose
Scroll down and double click "Run Shell Script"
Paste (w/ quotes) -> "/usr/local/bin/virt-manager"
File -> Save -> Click down arrow to expand view -> Choose "Applications" -> Save As: virt-manager -> File Format: Application -> Save
b) Add virt-manger icon to app:
Grab virt-manager icon @ https://icon-icons.com/icon/virt-manager/94317 (just click icon and drag to desktop)
Double click icon (it will open in Preview)
CTRL-C to copy
Applications -> virt-manager -> Right Click -> Get Info
Click on icon and CTRL-V to paste
3. Connect to Unraid
a) Launch virt-manager
Applications -> virt-manager
b) Add connection to Uraid
File -> Add Connection
Hypervisor: Custom URI
Autoconnect: Checked
Custom URI: qemu+tcp://root@<unraid-server-ip>/system
** Note - There is no TLS or password auth setup. If you are running in environment where this is required I would suggest looking into ssh auth vs. tcp.