canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.77k stars 642 forks source link

Parallels compatibility #2004

Open soberich opened 3 years ago

soberich commented 3 years ago

Describe the bug Describe what your problem is.

After installing Parallels not able to start Multipass. Reinstalling Multipass with brew reinstall multipass fixes it until next Parallels launch.

To Reproduce Args like --cpus 6 --mem 6G --disk 15G might not affecting overall issue and not cause it, but provide a full reproducer on my machine with current setup.

  1. brew install multipass
  2. multipass launch --name parallels-issue --cpus 6 --mem 6G --disk 15G
  3. multipass shell parallels-issue - assume all should work fine
  4. Shutdown Multipass
  5. Maybe restart Mac, just in case
  6. brew install parallels
  7. Create VM with Parallels hypervisor (haven't tried launching Multipass with Apple, but anyways the issue present until Parallels launch, with this setup which is problematic)
  8. Launch Parallels Windows 10 - assume Windows starts normally should work fine
  9. Restart Mac, just in case (it's probably needed anyway)
  10. multipass shell parallels-issue

Expected behavior Windows and Ubuntu both run in Mac simultaneously or on it's own.

Actual behavior During the install image

Later usage attempt multipass shell image

Multipass vm instance remains in starting state.

Parallels works fine at all times. Multipass is able to launch whether simultaneously with Windows in Parallels or just on it's own only after brew reinstall multipass

Logs here it's vm name ..-cougar

bubbly-cougar-hyperkit.log multipassd.log

Additional info

Additional context system_profiler SPHardwareDataType

      Model Name: MacBook Pro
      Model Identifier: MacBookPro16,1
      Processor Name: 8-Core Intel Core i9
      Processor Speed: 2.4 GHz # <- quite problematic model
      Number of Processors: 1
      Total Number of Cores: 8
      L2 Cache (per Core): 256 KB
      L3 Cache: 16 MB
      Hyper-Threading Technology: Enabled
      Memory: 16 GB
      System Firmware Version: 1554.100.57.131.1 (iBridge: 18.16.14539.5.4,0)
      Activation Lock Status: Enabled
Saviq commented 3 years ago

Hi @soberich, thanks for your report.

Would you please provide your daemon logs after multipass shell fails?

soberich commented 3 years ago

@Saviq Edited. Done.

Saviq commented 3 years ago

@soberich thanks, when it's working, what IP do you get? I suspect Parallel's taking over the bridge the hyperkit instances get put on, and as a result we can't find the instance in /var/db/dhcpd_leases.

We'll need to dig in more if there's a way around it.

soberich commented 3 years ago

@Saviq

➜  multipass-bug multipass info --all
Name:           bubbly-cougar
State:          Running
IPv4:           172.16.15.4
Release:        Ubuntu 20.04.2 LTS
Image hash:     dbfe2c39782e (Ubuntu 20.04 LTS)
Load:           0.08 0.02 0.01
Disk usage:     5.3G out of 14.4G
Memory usage:   201.5M out of 5.8G
Saviq commented 3 years ago

Thanks @soberich, looks like we'll need to try and reproduce to dig out more.

lathiat commented 2 years ago

This is happening for me with 1.8.1+mac on a reasonably fresh Monteray install on an M1 Mac Mini. After installing parallels it's broken. qemu starts, but multipass doens't think it ever starts.

looking at the earlier output when it actually boots theres not really any output after this QMP step except the sshfs mounts. I can also see DHCP requests on bridge100:

12:38:17.117879 52:54:00:40:4b:d5 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 333: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 52:54:00:40:4b:d5, length 291 12:38:22.020196 52:54:00:40:4b:d5 > 16:98:77:03:a3:64, ethertype IPv6 (0x86dd), length 105: fe80::5054:ff:fe40:4bd5.51046 > fe80::1498:77ff:fe03:a364.53: 27172+ [1au] A? ntp.ubuntu.com. (43)

So it seems the IP configuration fails for some reason.

[2021-11-18T12:29:09.195] [info] [daemon] Starting Multipass 1.8.1+mac
[2021-11-18T12:29:09.195] [info] [daemon] Daemon arguments: /Library/Application Support/com.canonical.multipass/bin/multipassd --verbosity debug
[2021-11-18T12:29:33.054] [debug] [primary] process working dir ''
[2021-11-18T12:29:33.054] [info] [primary] process program 'qemu-system-aarch64'
[2021-11-18T12:29:33.054] [info] [primary] process arguments '-machine, virt,highmem=off, -accel, hvf, -drive, file=/Library/Application Support/com.canonical.multipass/bin/../Resources/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on, -nic, vmnet-macos,mode=shared,model=virtio-net-pci,mac=XX:XX:XX:XX:XX:XX, -cpu, cortex-a72, -device, virtio-scsi-pci,id=scsi0, -drive, file=/var/root/Library/Application Support/multipassd/qemu/vault/instances/primary/ubuntu-20.04-server-cloudimg-arm64.img,if=none,format=qcow2,discard=unmap,id=hda, -device, scsi-hd,drive=hda,bus=scsi0.0, -smp, 4, -m, 2048M, -qmp, stdio, -chardev, null,id=char0, -serial, chardev:char0, -nographic, -cdrom, /var/root/Library/Application Support/multipassd/qemu/vault/instances/primary/cloud-init-config.iso'
[2021-11-18T12:29:33.061] [debug] [qemu-system-aarch64] [3394] started: qemu-system-aarch64 -machine virt,highmem=off -nographic -dump-vmstate /private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/multipassd.cAOVjY
[2021-11-18T12:29:33.132] [info] [primary] process state changed to Starting
[2021-11-18T12:29:33.134] [info] [primary] process state changed to Running
[2021-11-18T12:29:33.135] [debug] [qemu-system-aarch64] [3395] started: qemu-system-aarch64 -machine virt,highmem=off -accel hvf -drive file=/Library/Application Support/com.canonical.multipass/bin/../Resources/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=XX:XX:XX:XX:XX:XX -cpu cortex-a72 -device virtio-scsi-pci,id=scsi0 -drive file=/var/root/Library/Application Support/multipassd/qemu/vault/instances/primary/ubuntu-20.04-server-cloudimg-arm64.img,if=none,format=qcow2,discard=unmap,id=hda -device scsi-hd,drive=hda,bus=scsi0.0 -smp 4 -m 2048M -qmp stdio -chardev null,id=char0 -serial chardev:char0 -nographic -cdrom /var/root/Library/Application Support/multipassd/qemu/vault/instances/primary/cloud-init-config.iso
[2021-11-18T12:29:33.135] [info] [primary] process started
[2021-11-18T12:29:33.135] [debug] [primary] Waiting for SSH to be up
[2021-11-18T12:29:33.267] [warning] [primary] qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=XX:XX:XX:XX:XX:XX: info: Started vmnet interface with configuration:
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=XX:XX:XX:XX:XX:XX: info: MTU:              1500
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=XX:XX:XX:XX:XX:XX: info: Max packet size:  1514
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=XX:XX:XX:XX:XX:XX: info: MAC:              0a:b7:0f:06:88:5a
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=XX:XX:XX:XX:XX:XX: info: DHCP IPv4 start:  192.168.64.1
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=XX:XX:XX:XX:XX:XX info: DHCP IPv4 end:    192.168.64.254
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=XX:XX:XX:XX:XX:XX: info: IPv4 subnet mask: 255.255.255.0
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=XX:XX:XX:XX:XX:XX info: UUID:             27C5B07E-EE1F-4458-8AD8-XXXXXXXXXX

[2021-11-18T12:29:33.267] [warning] [qemu-system-aarch64]
[2021-11-18T12:29:33.268] [debug] [primary] QMP: {"QMP": {"version": {"qemu": {"micro": 0, "minor": 1, "major": 6}, "package": ""}, "capabilities": ["oob"]}}^M

[2021-11-18T12:29:33.298] [debug] [primary] QMP: {"return": {}}^M

[2021-11-18T12:29:46.370] [debug] [primary] QMP: {"timestamp": {"seconds": 1637209786, "microseconds": 369962}, "event": "NIC_RX_FILTER_CHANGED", "data": {"path": "/machine/unattached/device[9]/virtio-backend"}}^M
lathiat@Trents-Mac-mini % multipass start 
start failed: The following errors occurred:                                    
primary: timed out waiting for response
lathiat commented 2 years ago

Actually turns out this was caused by the Firewall. Turning off the firewall fixes it. I attempted to add bootpd and qemu to the firewall exception list to no avail.