1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
| MY_OPTIONS="+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check"
ALLOCATED_RAM="1G" # MiB
CPU_SOCKETS="1"
CPU_CORES="6"
CPU_THREADS="12"
args=(
-name "macos"
-enable-kvm -m "$ALLOCATED_RAM" -cpu host,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,"$MY_OPTIONS"
-machine q35
-usb -device usb-kbd -device usb-tablet # 鼠标穿透 mac 和win linux 都适用 键盘鼠标正常
-smp "$CPU_THREADS",cores="$CPU_CORES",sockets="$CPU_SOCKETS"
-smbios type=2
-device ich9-intel-hda -device hda-duplex
-device ich9-ahci,id=sata
#qemu-img create -f qcow2 alpine-sys.qcow2 50G
-cdrom /mnt/hdd/iso/linux/alpine-virt-3.16.3-x86_64.iso
-drive index=0,media=disk,format=qcow2,if=virtio,file=/mnt/ssd/alpinx-kvm/alpine-sys.qcow2
-netdev user,id=net0,smb=/mnt,hostfwd=tcp::8006-:3306,hostfwd=tcp::8222-:22
-device virtio-net-pci,addr=0x10,netdev=net0,id=net0,mac=52:54:00:c9:18:27
-monitor stdio
-vga virtio
-display none
-vnc 0.0.0.0:8 -k en-us
)
qemu-system-x86_64 "${args[@]}"
|