Importing settings from qemu kvm to proxmox web interface

blade023

New Member
Apr 6, 2021
5
0
1
42
Greetings!

tl,dr:
Is there an easy way to import settings from an independent qemu vm (running on the proxmox host) to the web interface managed vm's??

I've recently started dabbling in proxmox kvm's as I got some new hardware and wanted to share it with various systems, one of which is MacOS (preferably Mojave - 10.14) but here's my problem:

I can't get any MacOS installer to boot (or apparently recognise) despite following multiple guides (with a fresh vm each time to avoid contamination) when I create a vm with the web interface. The vm WILL boot either clover bootloader OR opencore bootloader, and they can both (in some cases) see that there is install media present (configured as a hard drive rather than cdrom by changing 'media=cdrom' to 'cache=unsafe' in the 1xx.conf for the vm.

So to make sure my hardware was actually capable I followed this guide..
https://github.com/foxlet/macOS-Simple-KVM
And managed to get a working MacOS (which I could vnc into with ssh tunneling - gotta love ssh) which I installed Mojave on to, and even made bootable without clover by copying the EFI folder to the vm's hd.

Now that I have a functional vm using qemu, I'd like to create a matching vm using proxmox's web interface (adjusting settings via bash if required) so that I can manage said machine along with the others I have. These being: a freenas server for file share, a windows 10 vm to run steam with gpu passthrough and a debian workstation, among others.

I notice there's a make.sh script included with the 'simple kvm' git repo, that creates a 'virt-manager' configuration, is this something I could use? I've looked through the xml template to try to match settings when configuring the proxmox vm to no avail.

My setup:
Asus B550-PLUS
Ryzen 7 3700X
Proxmox
Virtual Environment 6.3-6

Appreciate any help or suggestions that could point me in the right direction, I've been tinkering with this for a few days!
 
I have no experience with raw qemu VMs, but if you have a conf file for it, you should be fine with putting it in /etc/pve/qemu-server/<vmid>.conf
 
yah, that's the trouble, I can't see a conf in the repo I got. It looks like it's just running qemu-system-x86_64 with a load of arguments. This is what starts the vm...

Code:
#!/bin/bash

OSK="***REDACTED***"
VMDIR=$PWD
OVMF=$VMDIR/firmware
#export QEMU_AUDIO_DRV=pa
#QEMU_AUDIO_DRV=pa

qemu-system-x86_64 \
    -enable-kvm \
    -m 2G \
    -machine q35,accel=kvm \
    -smp 4,cores=4 \
    -cpu Penryn,vendor=GenuineIntel,kvm=on,+sse3,+sse4.2,+aes,+xsave,+avx,+xsaveopt,+xsavec,+xgetbv1,+avx2,+bmi2,+smep,+bmi1,+fma,+movbe,+invtsc \
    -device isa-applesmc,osk="$OSK" \
    -smbios type=2 \
    -drive if=pflash,format=raw,readonly,file="$OVMF/OVMF_CODE.fd" \
    -drive if=pflash,format=raw,file="$OVMF/OVMF_VARS-1024x768.fd" \
    -vga qxl \
    -device ich9-intel-hda -device hda-output \
    -usb -device usb-kbd -device usb-tablet \
    -netdev user,id=net0 \
    -device e1000-82545em,netdev=net0,id=net0,mac=d9:22:68:45:dd:e3 \
    -device ich9-ahci,id=sata \
    -drive id=ESP,if=none,format=qcow2,file=ESP.qcow2 \
    -device ide-hd,bus=sata.2,drive=ESP \
    -drive id=InstallMedia,format=raw,if=none,file=BaseSystem.img \
    -device ide-hd,bus=sata.3,drive=InstallMedia \
    -drive id=SystemDisk,if=none,file=mojavehd.qcow2 \
    -device ide-hd,bus=sata.4,drive=SystemDisk \

The redacted part is just a 'well known' key that some don't like shared...
 
Did you try to create a VM with those values? Looks pretty straightforward on first look. You can add the qcow2 file as a disk as well along with the other stuff.
 
Might look fairly simple, but there are things that don't seem to tally up with the options available on the web interface. Such as the OVMF_CODE.fd and OVMF_VARS-1024x768.fd 'drives'. I'm guessing they're important and something to do with the bios of the vm, as the screen resolution is mentioned in various install guides. Also the '-device ide-hd,bus=sata'... is that an ide drive or a sata drive?? Lots of the options are there in the web interface, but not all. I'm thinking there's something I'm missing, and it's probably obvious but it must be under the blind c**t section cos I can't see it! Thanks for the input though.

The real frustration is that i KNOW I can run Mojave under virtualisation on this hardware!
 
I feel you. :)
A lot of options can be set on the command line as well via qm set, maybe you can dig into the man page
 
Finally done it! I was searching through the git repo for the 'mac os simple kvm' by foxlet, and found a reference to proxmox where someone figured out how to set the .conf file, and they also made a custom ovmf file.

https://github.com/foxlet/macOS-Simple-KVM/issues/161

Now it's running from proxmox, onto the arduous task of getting sound and 3d graphics working!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!