2021年08月30日

macos上的虚拟化

操作系统引导恢复

Win10

Win10引导需要用Win10系统盘来修复。从 M$ 官方网站下载,创建安装u盘。

在BIOS里设置U盘启动,进入Win10安装界面,点击 “下一步” ,在新的页面选择左下角的 “修复计算机”。

修复界面依次选择:疑难解答->高级工具->命令提示符 进入命令行,显示 X:\Sources> ,之后用到 diskpartbcdboot 命令。

diskpart 找到efi分区

用到如下指令 list disk 列出所有挂在磁盘 list par 列出当前磁盘分区 sel disk x 选择某一磁盘x sel par x 选择某一分区x

diskpart      //进入diskpart工具
list disk     //查看所有磁盘
sel disk x      //根据情况选择windows的磁盘编号,x为磁盘编号
list par     //列出上一步所选磁盘的分区,其中就有存放efi的分区,类型为系统,大小几百M
# 或者 list vol,注意看每个volumne的分区格式是否正确

select par x       //选择efi的分区,x为分区编号
# 或者 select volumne x

assign letter=o     //为选择的分区分配一个盘符为o以便修复
exit      //退出diskpart,不要关闭命令行框

bcdboot进行修复

c:\ 不一定是系统盘,需要用 dir 命令查看盘内文件来判断哪个是系统盘, dir c:\dir d:\ 等,记住系统盘是哪个。

然后执行

bcdboot x:\windows /s o: /f uefi /l zh-cn #其中x为系统盘盘符。

会提示“已成功创建启动文件”。

然后输入 exit 退出命令行,关机重启或者 “继续” 就能进入Windows了。

Ubuntu

用Ubuntu的安装u盘启动,选择第四项 “firmware”,重启后就可以直接进入grub引导。

恢复UEFI引导项

装完catalina后,win10和Ubuntu的引导项都丢失了。在恢复Ubuntu的引导项后,OC的又没有了,真是折腾啊。

Ubuntu中增加uefi启动选项

Ubuntu的u盘启动速度比win10的快,命令多,优先使用Ubuntu恢复OC的启动选项。

用efibootmgr增加启动选项到bios。Ubuntu默认安装了efibootmgr。

U盘引导后,命令行

sudo su -
lsbkf -f
blkid

# 确认
eftbootmgr

win10中增加uefi启动选项

RE

引导

OC引导Ubuntu

OC看不见Ubuntu分区。

Ubuntu的grub2引导OC

grub2引导oc的问题是,不确定会对黑苹果造成什么影响,为了更好的定位问题,还是考虑用OC进行引导。

host macos/VirtualBox

在同一块nvme ssd上的不同分区。想通过VirtualBox直接访问ssd上对应的分区。

efi安装的系统,启动是麻烦啊。

efi分区由于是macos在用,为了安全起见,不能把用户的读写权限给加到 /dev/disk0s5 上。只能把分区 dd 后,转为 vdi 格式。

dd if=/dev/disk0s5 of=~/VirtualBox_VMs/win10/efi.img
VBoxMange convertrawdisk efi.img efi.vdi

win10 vm

efi windows ntfs windows recovery linux linux swap

fs0: EFI\Microsoft\Boot\bootmgfw.efi # 没有反应,不知道为什么?

[2021-08-31 Tue 16:48] 昨天晚上在用本地的nvme ssd盘的partition 1、5后,win10启动会蓝屏,checksum不正确,应该是系统认为换成sata盘的问题,今天安装了extention pack后,应该可以支持nvme了。在hp zhan66 pro g1上用macos测试,会蓝屏,win10起不来。

[2021-09-01 Wed 17:54] 要关闭win10 home edition的更新,否则一更新就容易把虚机搞定。

德语的,要翻译 https://the-digital-native.de/?p=366

主要看grub的那部份。

I recently purchased a Lenovo P1 that already had Windows 10 Pro preinstalled . Of course, I installed a Linux right away: In my case, a Kubuntu 20.04. For this I reduced the existing NTFS partition with Windows installation to 850GB and created 100GB free space for Linux. Why did I leave the NTFS partition so big? Because, according to my research, it works much better to write from Linux on an NTFS partition than to set up an ext4 partition in Windows. The common data partition becomes the Windows NTFS partition. I did not use a swap partition at all, since 48GB Ram will be enough for everything.

So now I have a dual boot system Ubuntu 20.04 / Windows 10. That's fine. But even under Linux I like to quickly need the Windows functionalities at hand (Photoshop, …). And since maintaining two Windows 10 instances is twice the effort, a possibility to boot the physical system in VirtualBox comes in handy here. That’s what this is about.

ubuntu vm

生成raw partition的vmdk文件

https://www.virtualbox.org/manual/ch09.html#adv-storage-config

# 查看partition
diskutil list

# 查看partition的uuid
diskutil info /dev/disk0s5

diskutil umountDisk /dev/disk0s3

# 修改owner
sudo chown albert /dev/disk0s3

# 把Ubuntu使用的ext4分区和swap分区加到raw partition中.
# disk0s3是主分区
# disk0s4是swap分区
$ VBoxManage internalcommands createrawvmdk -filename \
~/VirtualBox_VMs/ubuntu/raw-ubuntu.vmdk -rawdisk /dev/disk0 -partitions 3,4

# 在Virtualbox中注册Ubuntu使用的partition,至少要有 read 权限,否则注册会报错

efi启动

sudo chmod o+r /dev/disk0s5

sudo vifs

efi linux linux swap

使用host io

efi启动后,会进入 efi shell中 fs0: EFI\ubuntu\grub2x64.efi #

选择高级 e ctrl+x 启动 然后就看见kernel panic,这是什么意思?

dsm vm

panic问题 [2021-09-02 Thu 10:49]

发现VirtualBox启动后,在一分钟以内,必然panic重启。可能和sata控制器有关,具体原因不明。但是用qemu是ok的

bridge模式无法获取通过dhcp分配ip问题 [2021-09-02 Thu 10:51]

在启动了VirtualBox的dhcp功能后,可以获取到ip了,神奇啊,折腾了好久都搞不定,配上dhcp地址池后就ok了,什么原因?

pci passthrough - 在macos明确不支持,操作系统不支持

只有linux才能支持

nat + intel桌面网卡 [2021-09-02 Thu 09:18]

可以获取到ip,能上网

nat + virtio

panic [2021-09-02 Thu 10:02]

admin@dsm617:/$ [ 96.549152] init: Caught abort, core dumped [ 96.555890] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000600 [ 96.555890] [ 96.563169] CPU: 1 PID: 1 Comm: init Tainted: P C O 3.10.102 #15284 [ 96.567909] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 96.574741] ffffffff814aafc8 ffffffff814aa09c 0000000000000010 ffff8800bb4a7ee8 [ 96.580367] ffff8800bb4a7e80 ffffffff8105dbf5 0000000000000600 ffff8800bb485b58 [ 96.586268] ffff8800bb485af0 0000000000000000 000000000000bb07 ffff8800b9275480 [ 96.592308] Call Trace: [ 96.594147] [<ffffffff814aafc8>] ? dump_stack+0xc/0x15 [ 96.597834] [<ffffffff814aa09c>] ? panic+0xbb/0x1ce [ 96.600463] [<ffffffff8105dbf5>] ? sched_move_task+0x95/0x110 [ 96.604490] [<ffffffff81036689>] ? do_exit+0xa29/0xa30 [ 96.609159] [<ffffffff810366f7>] ? do_group_exit+0x37/0x90 [ 96.612572] [<ffffffff8103675b>] ? SyS_exit_group+0xb/0x10 [ 96.617626] [<ffffffff814b0fb2>] ? system_call_fastpath+0x16/0x1b [ 96.622303] Rebooting in 3 seconds.. [ 99.709414] ACPI MEMORY or I/O RESET_REG.

host macos/QEMU [2021-09-01 Wed 17:56]

通过串口debug的时候真是爽,不知道VirtualBox要怎么配置,倒是可以把console的log打到文件里面,就是需要登录到console上,看看dsm磁盘和网卡的情况。为什么获取不到ip,不挂硬盘,单独用dsm的image是可以进入到console的。

dsm vm

网卡只能用bridge方式,需要tuntap 或者 tunnelblick的tuntap kext。推荐用tunnelblick进行过签名的kext版本。

nat + e1000 [2021-09-02 Thu 09:21]

不配置网卡的话,默认是e1000

可以获取到ip,能上网

sudo qemu-system-x86_64 \
-cpu host \
-accel hvf \
-display none \
-machine pc \
-monitor tcp:0.0.0.0:4001,server,nowait \
-m 3072 \
-serial telnet:0.0.0.0:5001,server,nowait \
-drive if=ide,format=raw,file=synoboot-ds3617xs-dsm617-20200824.img \
-net nic,model=e1000e,macaddr=00:11:32:f4:e4:18 \
-net tap,ifname=tap0,script=no,downscript=no

#-net nic,model=virtio,macaddr=00:11:32:f4:e4:32 \
sudo qemu-system-x86_64 \
-cpu host \
-accel hvf \
-display none \
-machine pc \
-monitor tcp:0.0.0.0:4001,server,nowait \
-m 3072 \
-serial telnet:0.0.0.0:5001,server,nowait \
-drive if=ide,format=raw,file=synoboot-ds3617xs-dsm617-20200824.img \
-device virtio-net-pci,netdev=eth0,mac='00:00:00:01:00:02' \
-netdev tap,ifname=tap0,id=eth0,script=no,downscript=no

# -device e1000e,netdev=eth0,mac='00:00:00:01:00:01' \
# -netdev tap,ifname=tap0,id=eth0,script=no,downscript=no,vhost=on

-device virtio-net-pci,netdev=dev1,mac='00:00:00:01:00:02',vectors=32,mq=on \
-netdev tap,ifname=tap-0,id=dev1,script=no,downscript=no,vhost=on,queues=16 \

sudo sysctl net.inet.ip.forwarding=1
sudo sysctl net.link.ether.inet.proxyall=1
# sudo sysctl net.inet.ip.fw.enable=1

[2021-09-02 Thu 15:17] https://github.com/Tunnelblick/Tunnelblick/issues/73 [2021-09-02 Thu 15:56] 设置DHCP后,在tap0上居然可以抓到dhcp的ack包了,神奇了,但是为什么dsm不认呢?

sudo ifconfig bridge0 addm tap0
sudo ipconfig set tap0 DHCP

qemu help [2021-09-02 Thu 15:39]

$qemu-system-x86_64 -nic model=help
Supported NIC models:
e1000
e1000-82544gc
e1000-82545em
e1000e
i82550
i82551
i82557a
i82557b
i82557c
i82558a
i82558b
i82559a
i82559b
i82559c
i82559er
i82562
i82801
ne2k_pci
pcnet
rtl8139
tulip
virtio-net-pci
virtio-net-pci-non-transitional
virtio-net-pci-transitional
vmxnet3
$qemu-system-x86_64 -device e1000e,help
e1000e options:
  acpi-index=<uint32>    -  (default: 0)
  addr=<int32>           - Slot and optional function number, example: 06.0 or 06 (default: -1)
  bootindex=<int32>
  disable_vnet_hdr=<uint8> - Do not use virtio headers, perform SW offloads emulation instead (default: 0)
  failover_pair_id=<str>
  mac=<str>              - Ethernet 6-byte MAC Address, example: 52:54:00:12:34:56
  multifunction=<bool>   - on/off (default: false)
  netdev=<str>           - ID of a netdev to use as a backend
  rombar=<uint32>        -  (default: 1)
  romfile=<str>
  romsize=<uint32>       -  (default: 4294967295)
  subsys=<uint16>        - PCI device Subsystem ID (default: 0)
  subsys_ven=<uint16>    - PCI device Subsystem Vendor ID (default: 32902)
  x-pcie-extcap-init=<bool> - on/off (default: true)
  x-pcie-lnksta-dllla=<bool> - on/off (default: true)
-device e1000e,netdev=dev0,mac='00:00:00:01:00:01' \
-netdev tap,ifname=tap-int,id=dev0,script=no,downscript=no,vhost=on \

-device virtio-net-pci,netdev=dev1,mac='00:00:00:01:00:02',vectors=32,mq=on \
-netdev tap,ifname=tap-0,id=dev1,script=no,downscript=no,vhost=on,queues=16 \

nat + e1000 + raw physical disk [2021-09-02 Thu 10:53]

可以telnet正常登录,看见盘,需要解决dhcp获取ip的问题

[2021-09-02 Thu 11:05] 如果VirtualBox可以bridge方式获取dhcp,那intel的网卡驱动应该是没有问题的吧,为什么qemu使用操作系统的bridge方式就不行呢?

[2021-09-02 Thu 11:13] 不用tunnelblick的tap kext,改为tuntaposx的看看,用brew install tuntap 安装

vmnet for qemu on macos - 要编译源码吗? [2021-09-02 Thu 16:28]

https://forum.osdev.org/viewtopic.php?f=1&t=39828

https://lists.gnu.org/archive/html/qemu-devel/2021-02/msg04637.html

另外一个用vmnet.framework给qemu打patch的,牛逼啊 https://www.mail-archive.com/qemu-devel@nongnu.org/msg816630.html

真多,有问问题的,没有答案 https://www.mail-archive.com/qemu-devel@nongnu.org/msg750375.html

compile qemu on macos [2021-09-02 Thu 17:41]

https://alexwinston.wordpress.com/2015/09/10/compiling-qemu-on-osx/

Compiling QEMU on OSX

After googling quite extensively I was unable to find a definitive guide to compile QEMU on OS X Yosemite so I pieced together the steps myself and have documented them below. It should be noted that MacPorts does have a port for QEMU 2.3 but I wanted to compile the newest version from GitHub myself.

It is assumed that Xcode and the CLI tools are already installed.

The first and most important step is to install MacPorts

After this is complete it is a simple matter of installing the required ports from the command line.

sudo port install pkgconfig sudo port install glib2 sudo port install libpixman sudo port self update sudo port upgrade outdated

After the ports have been installed the QEMU source should be downloaded from github from the command line.

git clone git://git.qemu.org/qemu.git;

After downloading the source the most important piece of the puzzle seems to be the following

cd qemu git submodule update –init dtc

Once this submodule has been downloaded you can configure and make QEMU.

./configure –enable-cocoa –target-list=i386-softmmu,arm-softmmu,x86_64-softmmu,aarch64-softmmu –disable-vnc make

This particular configuration demonstrates compiling several of the target architectures available in QEMU. Adding or removing architectures from the –target-list will be required to meet your particular needs.

If QEMU builds successfully you should now have directories for each architecture listed in the –target-list.

A simple way to test that everything is working as expected is to run QEMU for x86_64. Before you do this however it is worth downloading the Tiny Core Linux iso for testing in QEMU.

./x86_64-softmmu/qemu-system-x86_64 -cdrom Core-current.iso -boot d -net nic -net user,hostfwd=tcp:127.0.0.1:8008-:80

Tiny Core Linux should boot and drop you to a command prompt after pressing “enter”.

The following links were invaluable in helping to determine exactly how to build and test QEMU 2.4 on the Mac.

https://jon.sprig.gs/blog/post/53 https://github.com/psema4/pine/wiki/Installing-QEMU-on-OS-X http://blog.definedcode.com/osx-qemu-kvm https://theintobooks.wordpress.com/2012/10/30/installing-qemu/ http://blogs.coreboot.org/blog/2015/06/03/gsoc-coreboot-for-arm64-qemu-week-1/ http://www.bennee.com/~alex/blog/2014/05/09/running-linux-in-qemus-aarch64-system-emulation-mode/

也可以看看 https://theintobooks.wordpress.com/2016/03/03/installing-qemu-on-mac-os-x-el-capitan/

Build qemu on MacOS Submitted by peter on Fri, 02/02/2018 - 11:51 看着qemu的版本很老 https://notes.bitfunnel.net/?q=node/50

使用不同的glibc [2021-09-08 Wed 09:35]

brew install安装的glib版本太高,查到只有2.58.3及以下的版本编译的qemu,bridge+tap才是正常的。而且2.58.3以下版本编译的qemu,使用vmnet framework也是ok的。

失败的尝试

试了下面几个环境变量,configure会报错。

GLIBC=/Volumes/sandisk/Users/albert/glib-2.58.3
./configure --enable-cocoa --target-list=x86_64-softmmu GLIB_LIBS="-L/Volumes/sandisk/Users/albert/glib-2.58.3 -lglib-2.0 -lgobject-2.0 -lgthread-2.0 -lgmodule-2.0"
export GLIB_CONFIG=/Volumes/sandisk/Users/albert/glib-2.58.3
./configure --enable-cocoa --target-list=x86_64-softmmu

./configure --enable-cocoa --target-list=x86_64-softmmu --with-internal-glib=/Volumes/sandisk/Users/albert/glib-2.58.3

尝试一下自己编译的c文件是否能读到glib版本,编译过不去。

#-I/usr/local/Cellar/glib/2.68.4/include -I/usr/local/Cellar/glib/2.68.4/include/glib-2.0 -I/usr/local/Cellar/glib/2.68.4/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.45/include -Werror -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -m64 -fstack-protector-strong -L/usr/local/Cellar/glib/2.68.4/lib -L/usr/local/opt/gettext/lib -lgthread-2.0 -lglib-2.0

gcc -I/Volumes/sandisk/Users/albert/glib-2.58.3/include -I/Volumes/sandisk/Users/albert/glib-2.58.3/lib/glib-2.0/include -I/Volumes/sandisk/Users/albert/glib-2.58.3/include/glib-2.0 -Werror -L/Volumes/sandisk/Users/albert/glib-2.58.3/include -lglib-2.0 *.c

qemu的configure里是通过pkg-config来找依赖的modules的编译和头文件路径的

详解pkg-config –cflags –libs glib-2.0的作用 https://blog.csdn.net/shenwansangz/article/details/48738677

[2021-09-08 Wed 11:02] 看了半天,在configure里面看见是通过 pkg-config 来查找 glib 的path,服了,搞死人啊。

./configure

3294 ##########################################
3295 # glib support probe
3296 
3297 glib_req_ver=2.48
3298 glib_modules=gthread-2.0
3299 if test "$modules" = yes; then
3300     glib_modules="$glib_modules gmodule-export-2.0"
3301 fi
3302 if test "$plugins" = yes; then
3303     glib_modules="$glib_modules gmodule-2.0"
3304 fi
3305 
3306 for i in $glib_modules; do
3307     if $pkg_config --atleast-version=$glib_req_ver $i; then
3308         glib_cflags=$($pkg_config --cflags $i)
3309         glib_libs=$($pkg_config --libs $i)
3310     else
3311         error_exit "glib-$glib_req_ver $i is required to compile QEMU"
3312     fi
3313 done

# 直接设置环境变量
PKG_CONFIG_PATH=/Volumes/sandisk/Users/albert/glib-2.58.3/lib/pkgconfig pkg-config --libs gthread-2.0

# 这样编译是ok的。查看 build/config.log里面的glib指向了2.58.3版本的glib
PKG_CONFIG_PATH=/Volumes/sandisk/Users/albert/glib-2.58.3/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --enable-cocoa --target-list=x86_64-softmmu

本机上用 pkg-config 查看 gthread-2.0 的结果,用的是brew安装的glib,版本是2.66.4_1

$pkg-config --libs gthread-2.0

-L/usr/local/Cellar/glib/2.66.4_1/lib -L/usr/local/opt/gettext/lib -lgthread-2.0 -lglib-2.0 -lintl

pkg-config说明

The pkg-config package contains tools for passing the include path and/or library paths to build tools during the make file execution.

pkg-config is a function that returns meta information for the specified library.

The default setting for PKG_CONFIG_PATH is /usr/lib/pkgconfig because of the prefix we use to install pkgconfig. You may add to PKG_CONFIG_PATH by exporting additional paths on your system where pkgconfig files are installed. Note that PKG_CONFIG_PATH is only needed when compiling packages, not during run-time.

vmnet-v6.1.0-patches-v2版本

[2021-09-08 Wed 12:14] 编译

cd /Volumes/sandisk/Users/albert/workspace/vmnet-v6.1.0-patches-v2/qemu
PKG_CONFIG_PATH=/Volumes/sandisk/Users/albert/glib-2.58.3/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --enable-cocoa --target-list=x86_64-softmmu --enable-vmnet --enable-vhost-net

# 报错,只支持linux --enable-vhost-scsi --enable-vhost-kernel

[2021-09-08 Wed 12:25:11] --enable-vhost-net 在link的时候报错了。

查看编译的qemu支持的网络模式

[albert@G1 /Volumes/sandisk/Users/albert/workspace/vmnet-v6.1.0-patches-v2/qemu/build]
$./qemu-system-x86_64 -netdev type=help 
Available netdev backend types:
socket
hubport
tap
user
vde
bridge
vhost-user
vmnet-host
vmnet-shared
vmnet-bridged

用qemu启动DSM进行测试,很好,DSM启动ok,可以进入系统,通过DHCP获取ip。

cd /Volumes/sandisk/Users/albert/workspace/vmnet-v6.1.0-patches-v2/qemu/build
sudo ./qemu-system-x86_64 \
-cpu host \
-smp 2 \
-accel hvf \
-display none \
-machine pc \
-monitor tcp:0.0.0.0:4001,server,nowait \
-m 3072 \
-serial telnet:0.0.0.0:5001,server,nowait \
-drive if=ide,format=raw,file=/Users/albert/dsm/synoboot-ds3617xs-dsm617-20200824.img \
-drive format=raw,file=/dev/disk1s4 \
-device virtio-net-pci,netdev=eth0,mac='00:11:32:01:02:03' \
-netdev vmnet-bridged,id=eth0,ifname=en3

#-drive if=ide,format=raw,file=/dev/disk1s4 \
sudo ./qemu-system-x86_64 \
-cpu host \
-smp 2 \
-accel hvf \
-display none \
-machine q35 \
-monitor tcp:0.0.0.0:4001,server,nowait \
-m 3072 \
-serial telnet:0.0.0.0:5001,server,nowait \
-drive if=ide,format=raw,file=/Users/albert/Downloads/alpine-standard-3.14.2-x86_64.iso \
-device virtio-net-pci,netdev=eth0,mac='00:11:32:01:02:03' \
-netdev vmnet-bridged,id=eth0,ifname=en3

[2021-09-08 Wed 15:18] 使用 virtio-scsi,没有悬念,必挂无疑,直接panic了。

./qemu-system-x86_64 \
-cpu host \
-smp 2 \
-accel hvf \
-display none \
-machine q35 \
-monitor tcp:0.0.0.0:4001,server,nowait \
-m 3072 \
-serial telnet:0.0.0.0:5001,server,nowait \
-drive if=ide,format=raw,file=/Users/albert/dsm/synoboot-ds3617xs-dsm617-20200824.img \
-device virtio-scsi-pci,id=scsi0,num_queues=4 \
-device scsi-hd,drive=drive0,bus=scsi0.0,channel=0,scsi-id=0,lun=0 \
-drive file=/dev/disk1s4,if=none,id=drive0
sudo ./qemu-system-x86_64 \
-cpu host \
-smp 2 \
-accel hvf \
-display none \
-machine q35 \
-monitor tcp:0.0.0.0:4001,server,nowait \
-m 3072 \
-serial telnet:0.0.0.0:5001,server,nowait \
-drive if=ide,format=raw,file=/Users/albert/dsm/synoboot-ds3617xs-dsm617-20200824.img \
-device megasas,id=scsi0 \
-device scsi-hd,drive=drive0,bus=scsi0.0,channel=0,scsi-id=0,lun=0 \
-drive file=/dev/disk1s4,if=none,id=drive0

virtio-blk 看看如何?找不到硬盘。

sudo ./qemu-system-x86_64 \
-cpu host -smp 2 -accel hvf  -machine q35  -m 3072 \
-display none -monitor tcp:0.0.0.0:4001,server,nowait \
-serial telnet:0.0.0.0:5001,server,nowait \
-drive if=ide,format=raw,file=/Users/albert/dsm/synoboot-ds3617xs-dsm617-20200824.img \
-device virtio-blk-pci,drive=drive0,id=virtblk0,num-queues=4 \
-drive file=/dev/disk1s4,if=none,id=drive0

看看iso格式,如何用qemu命令行加载。

qemu-system-x86_64 -bios /usr/share/ovmf/ovmf_x64.bin \
-cpu host -enable-kvm -m 2G \
-drive file=/dev/md0,media=disk,format=raw \
-cdrom /path/to/windows.iso

[2021-09-08 Wed 16:42] 用这个命令

sudo ./qemu-system-x86_64 \
-machine q35 -cpu host -smp 2 -accel hvf -m 3072 \
-display none \
-monitor tcp:0.0.0.0:4001,server,nowait \
-serial telnet:0.0.0.0:5001,server,nowait \
-drive if=ide,format=raw,file=/Users/albert/dsm/synoboot-ds3617xs-dsm617-20200824.img \
-drive format=raw,file=/dev/disk1s4 \
-device virtio-net-pci,netdev=eth0 \
-netdev vmnet-bridged,id=eth0,ifname=en3

macports是如何编译qemu的 [2021-09-09 Thu 09:19]

已经从前几天安装是的5.2版本升级到6.1.0版本了 https://github.com/macports/macports-ports/blob/master/emulators/qemu/Portfile

iperf3 测试网速和cpu [2021-09-08 Wed 16:46]

用wifi的效果可以。在600Mb/s,再用网线试试。

macos是否有losetup和mdadm类似的命令

https://apple.stackexchange.com/questions/9284/does-mac-have-something-similar-to-a-linux-loop-device-alternative-to-losetup

gvt-d on macos

linux上的,不是macos上的 https://www.reddit.com/r/VFIO/comments/innriq/successful_macos_catalina_with_intel_gvtg/

没有说怎么做 https://apple.stackexchange.com/questions/205514/virtualization-with-intels-gvt-d-on-mid-2015-macbook-pro

这里讨论了gpu pci passthrough在macos的情况,结论是没有可能。 https://forums.macrumors.com/threads/egpu-parallels.2276462/