qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-discuss] qemu with -accel hvf


From: Dominik Epple
Subject: [Qemu-discuss] qemu with -accel hvf
Date: Wed, 26 Sep 2018 15:20:23 +0200

Hi,

let me introduce myself, I am new on this list, currently playing around
with qemu on macOS, trying to run virtual machines (linux guests, e.g.
centos7) with hypervisor.framework acceleration. (Not interested in any
desktop/graphics stuff, they should just run network services like
databases and java services, for testing / development purposes).

It seems to work fine, however some question arose during my experiments,
for which I'd like to ask input for here. Not all of this stuff is
hvf-specific, maybe some stuff is also macOS-specific, or even generic.

So my process looks like:

Prepare networking: I want to use bridged networking, so prepare a bridge
according to https://support.apple.com/kb/PH25775

Create a virtual disk:

qemu-img create -f qcow2 centos7.qcow 20G

To run a machine on that virtual disk:

sudo qemu-system-x86_64 -name centos7 -accel hvf -cpu host -m 2048 -k de
-drive file=centos7.qcow -netdev
tap,id=mynet0,br=bridge1,script=/.../netdev-up.sh,downscript=/.../netdev-down.sh
-device e1000,netdev=mynet0,mac=$MAC

The scripts are just doing "ifconfig bridge1 addm tap0" and "ifconfig
bridge1 deletem tap0" respectively where the interface name ("tap0") is
provided via $1.

For installing I use a command line like the one above, but with
additionally

-cdrom ~/Downloads/CentOS-7-x86_64-Minimal-1804.iso -boot d

Now my questions:

   1. What about paravirtualized hardware? Whenever I start playing around
   with virtio disks or network adapters, things work not. I don't know: are
   they expected to work only on linux / to not work on macOS hosts? I'd
   expect them to work as long as the guest OS supports them, which should be
   given using recent centos guests?
   2. When not using paravirtualized hardware, is it beneficial, from a
   performance point of view, to use something newer than "-machine pc" (what
   is the default), like "q35" for example?
   3. SMP is broken for me, nothing works when using -smp 2. Is this a know
   issue? Should I report a bug?
   4. Networking: I am using the opensource tuntap drivers via brew...
   which is kind of irritating to me, I was expecting the base OS provides
   such features. Is that really the right way to go? It seems to work, though.
   5. Networking: the helper scripts seem not to provide the name of the
   bridge, just the interface names. This seems to be a generic, as I find
   sample scripts with hardcoded bridge names also for other hosts (no macOS /
   no hvf) via internet searches. Is this expected? I would expect the bridge
   to be available via some variable. If I want to have a guest attach
   interfaces to different bridges, I'd need different scripts with hardcoded
   bridge names, which is clumsy.
   6. Networking: what is the difference between -netdev tap and -netdev
   bridge anyways? By documentation I understand both should create a tap
   device and have it attached to a bridge using the script=whatever.sh
   script. However that seems to work for me only for "-netdev tap", but
   "-netdev bridge" (-netdev bridge,id=mynet0,br=bridge1,helper=/.../helper.sh
   -device e1000,netdev=mynet0) produced strange garbage on qemu stdout, which
   irritates me.
   7. SMP is broken for me, nothing works when using -smp 2. Is this a know
   issue? Should I report a bug?

Guess that's it... any pointers on external ressources (macOS / hvf aware
wikis, howtos, etc) are greatly appreciated; I was unable to find any and I
found out most of the stuff above just by experimenting myself.

Thanks in advance!

Best regards
Dominik


reply via email to

[Prev in Thread] Current Thread [Next in Thread]