Ok, imagine that you use Mac and want to create virtual machines (not containers!) in a Linux server. But, aren't you tired to do that manually, over the command line (a.k.a., SSH)?
Well, maybe not… or maybe yes... 🤔 😃
After years of typing commands in virsh I've got to the conclusion that I'm kind of too old for that 😅.
The question is: what's the alternative if you use MacOS? Is it possible to execute virt-manager in MacOS without relying on the ported version? If yes, how?
That's when I discovered the power of XQuartz project. 👏 🚀

Basically, XQuartz is a version of the X.Org X Window System that runs on MacOS. The advantage of that is to use X11 forwarding over SSH, telling your server "hey, if the program I'm executing has a graphical interface I'm able to render it here on my side — bring it on!".
Sounds sexy, huh? Yes… with that you can execute a program with a Graphical User Interface (GUI) in your Linux server, but operating in your MacOS — remotely. Here we will focus on virt-manager , but it applies to anything else… even a bitcoin-gui running in your private and (super) secure server.
Below I will describe the steps to:
Allow X11 Forwarding in your Linux server (SSH daemon)
Install QEMU-KVM and all dependencies in a Ubuntu
Fix X11 keyboard mappings in your MacOS (ALT and CTRL keys compatibility)
Run
virt-managerusing SSH X11 Forwarding
Enable X11 Forwarding
The first step is to log in to your Linux server and add (or change if already exists) the following line in the/etc/ssh/sshd_config file:
Install QEMU-KVM
Now, let's install all the required tools to create and run a full-fledged virtual machine:
Then you should add your user to some groups in order to properly manage the virtual resources using libvirt:
Fix Keyboard Mappings in MacOS for X11
If it doesn't exist yet, create the file ~/.Xmodmap and add the following:
Run virt-manager through SSH
Ok… last but not least, here you go:
Something like this will come up:

That's it! 🚀
You will be able to create virtual machines and manage all your virtualized resources on that QEMU/KVM instance. 😃



