You are not logged in.

#1 2019-11-19 02:18:24

everwisher
Member
Registered: 2019-09-11
Posts: 33

How to run QEMU vm remotely without DEs installed locally on the host

Hey, guys! I’m planning to run Mikrotik RouterOS as a qemu guest in my home server and use it as the router in my house for better performance than hardware home routers. So I aim to achieve the goals down below but don’t have a clue yet because I am an absolute noob. Would you nice guys help me?

1. My Intel 82580 NIC with 4 ports has been bound to vfio driver according to the Arch Linux wiki tutorial, but I don’t know how to pass it QEMU commands. All I searched over the internet teach how to do it with libvirt.

2.  As a server the host is meant to run headlessly without desktop environments and to be accessed via SSH. But the installation process of RouterOS at least needs to be done with a monitor. However, I control the host on a MacBook with Catalina which no longer support XQuartz, the only SSH X11 forwarding option for macOS. Whenever I start qemu-system-x86_64 via SSH in macOS terminal, I get “gtk fails to initialize”.

So how can I do it with QEMU and a remote display protocol like VNC, SPICE or preferably noVNC as it requires nothing but a HTML5-enabled browser as client?

3. The qemu-based RouterOS vm has to launch itself before the network service for the control over physical network right? With systemd, how should I achieve the goal?

I know this is a big question so I’m grateful to anyone who can offer me even a segment of answer. ?

Offline

#2 2019-11-19 03:42:34

xse
Member
Registered: 2019-01-08
Posts: 36

Re: How to run QEMU vm remotely without DEs installed locally on the host

Hi,

I don't know much about virtualisation but here we go:

1) Is there any good reason for you not wanting to use libvirt ? It's easier for PCI passthrough like it just provides convenience. I'm under the impression that you think it's not what it is, libvirt just provide an easy way to manage your vms, they can still use Qemu and just be managed by libvirt, that will easily deal with providing the PCI device to your vm.
If you insist on not using libvirt, you can find examples of PCI passthrough using qemu without libvirt: on the arch wiki here and here for example.

2) There is a qemu-headless package (first line of the wiki page, installation section) & there is also a -vnc option. This information is available on the wiki along with detailed information on other available remote desktop protocol.

3) I assume that as long as you don't configure/use the pci device libvirt will be able to "detach/unbind" it if that makes sense, for "how to not use it", it depends on how you actually use it in the first place.

Furthermore i encourage you to read a lot about the subject, don't blindly copy/paste configs and commands without understanding what they do.
Good luck!


Carefully explaining your problem is half the solution.

Offline

#3 2019-11-19 04:50:40

everwisher
Member
Registered: 2019-09-11
Posts: 33

Re: How to run QEMU vm remotely without DEs installed locally on the host

I chose QEMU over libvirt because a friend of mine shared me a legally activated ROS image and a bunch of QEMU commands. I tried it with libvirt at first hand but it lost activation. My friend is not familiar with libvirt either and he just can’t spare too much time on it. I did find an article on RedHat documentation about converting QEMU arg file to libvirt xml configuration, but I failed at the attempt of it. Maybe I mistook an arg file for a QEMU script by just changing the file extension but I can’t find a way to make things right. Then I launched the ROS image with QEMU and things went well.

Offline

#4 2019-11-19 09:38:57

koffeinfriedhof
Member
Registered: 2017-11-30
Posts: 91

Re: How to run QEMU vm remotely without DEs installed locally on the host

Hi!

You may use the -vnc 0.0.0.0:0 Option to get a vnc-connection listening on "all hosts" and connect via TigerVNC or default vncviewer.

Or just use the virt-manager in your graphical environment, using ssh to connect to your qemu-host. Using Publickey is not implemented in graphic mode, but you can start the virt-manager using a manual command line. This will be saved and is only needed one time per host.

virt-manager -c 'qemu+ssh://user@qemuHost:1234/system?keyfile=~/.ssh/key_to_host'

Offline

Board footer

Powered by FluxBB