Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firewall randomly messing with Multipass networking on macOS #2387

Open
milopersic opened this issue Jan 4, 2022 · 212 comments
Open

Firewall randomly messing with Multipass networking on macOS #2387

milopersic opened this issue Jan 4, 2022 · 212 comments
Labels

Comments

@milopersic
Copy link

milopersic commented Jan 4, 2022

Update: If you are using an unmanaged Mac and run across this issue, the following commands may fix this issue:

/usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/libexec/bootpd
/usr/libexec/ApplicationFirewall/socketfilterfw --unblock /usr/libexec/bootpd

Original post

Multipass crashes unexpectedly, and all instances (including primary) will not restart. I am using multipass 1.8.1+mac,
multipassd 1.8.1+mac. (multipass --version), on macOS Monterey 12.1, M1 Max, 32 GB RAM. I installed multipass for macOS directly from Canonical's website.

start failed: The following errors occurred:                                    
dbarn: timed out waiting for response

This has happened twice. The first time I uninstalled multipass, reinstalled, and re-built my instances thinking it was a fluke. Multipass performed fine for roughly a week, then crashed again and I lost some work. I am not able to determine what the cause is, or how to reproduce it. System restarts do not help. I'm hoping someone can spot the issue in the logs.

Logs here:

[2022-01-04T13:30:56.044] [warning] [qemu-system-aarch64] 
[2022-01-04T13:30:56.044] [debug] [dbarn] QMP: {"QMP": {"version": {"qemu": {"micro": 0, "minor": 1, "major": 6}, "package": ""}, "capabilities": ["oob"]}}

[2022-01-04T13:30:56.062] [debug] [dbarn] QMP: {"return": {}}

[2022-01-04T13:31:08.663] [debug] [dbarn] QMP: {"timestamp": {"seconds": 1641321068, "microseconds": 663550}, "event": "NIC_RX_FILTER_CHANGED", "data": {"path": "/machine/unattached/device[7]/virtio-backend"}}

[2022-01-04T13:36:37.352] [debug] [dbarn] process working dir ''
[2022-01-04T13:36:37.353] [info] [dbarn] process program 'qemu-system-aarch64'
[2022-01-04T13:36:37.353] [info] [dbarn] 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=52:54:00:11:ff:d3, -cpu, cortex-a72, -device, virtio-scsi-pci,id=scsi0, -drive, file=/var/root/Library/Application Support/multipassd/qemu/vault/instances/dbarn/ubuntu-20.04-server-cloudimg-arm64.img,if=none,format=qcow2,discard=unmap,id=hda, -device, scsi-hd,drive=hda,bus=scsi0.0, -smp, 2, -m, 4096M, -qmp, stdio, -chardev, null,id=char0, -serial, chardev:char0, -nographic, -cdrom, /var/root/Library/Application Support/multipassd/qemu/vault/instances/dbarn/cloud-init-config.iso'
[2022-01-04T13:36:37.353] [warning] [Qt] QProcess: Destroyed while process ("qemu-system-aarch64") is still running.
[2022-01-04T13:36:37.370] [error] [dbarn] process error occurred Crashed program: qemu-system-aarch64; error: Process crashed
[2022-01-04T13:36:37.371] [info] [dbarn] process state changed to NotRunning
[2022-01-04T13:36:37.371] [error] [dbarn] error: program: qemu-system-aarch64; error: Process crashed
[2022-01-04T13:36:37.372] [warning] [Qt] QObject::connect(multipass::Process, Unknown): invalid nullptr parameter
[2022-01-04T13:36:37.372] [warning] [Qt] QObject::connect(multipass::Process, Unknown): invalid nullptr parameter
[2022-01-04T13:36:37.372] [warning] [Qt] QObject::connect(multipass::Process, Unknown): invalid nullptr parameter
[2022-01-04T13:36:37.372] [warning] [Qt] QObject::connect(multipass::Process, Unknown): invalid nullptr parameter
[2022-01-04T13:36:37.372] [warning] [Qt] QObject::connect(multipass::Process, Unknown): invalid nullptr parameter
[2022-01-04T13:36:37.372] [warning] [Qt] QObject::connect(multipass::Process, Unknown): invalid nullptr parameter
[2022-01-04T13:36:38.572] [debug] [update] Latest Multipass release available is version 1.8.0
[2022-01-04T13:36:40.666] [info] [VMImageHost] Did not find any supported products in "appliance"
[2022-01-04T13:36:40.671] [info] [rpc] gRPC listening on unix:/var/run/multipass_socket, SSL:on
[2022-01-04T13:36:40.673] [debug] [qemu-img] [1300] started: qemu-img snapshot -l /var/root/Library/Application Support/multipassd/qemu/vault/instances/tractorgeeks/ubuntu-20.04-server-cloudimg-arm64.img
[2022-01-04T13:36:40.677] [debug] [qemu-img] [1301] started: qemu-img snapshot -l /var/root/Library/Application Support/multipassd/qemu/vault/instances/primary/ubuntu-20.04-server-cloudimg-arm64.img
[2022-01-04T13:36:40.681] [debug] [qemu-img] [1302] started: qemu-img snapshot -l /var/root/Library/Application Support/multipassd/qemu/vault/instances/dbarn/ubuntu-20.04-server-cloudimg-arm64.img
[2022-01-04T13:36:40.686] [info] [daemon] Starting Multipass 1.8.1+mac
[2022-01-04T13:36:40.686] [info] [daemon] Daemon arguments: /Library/Application Support/com.canonical.multipass/bin/multipassd --verbosity debug
[2022-01-04T13:43:16.997] [debug] [dbarn] process working dir ''
[2022-01-04T13:43:16.998] [info] [dbarn] process program 'qemu-system-aarch64'
[2022-01-04T13:43:16.998] [info] [dbarn] 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=52:54:00:11:ff:d3, -cpu, cortex-a72, -device, virtio-scsi-pci,id=scsi0, -drive, file=/var/root/Library/Application Support/multipassd/qemu/vault/instances/dbarn/ubuntu-20.04-server-cloudimg-arm64.img,if=none,format=qcow2,discard=unmap,id=hda, -device, scsi-hd,drive=hda,bus=scsi0.0, -smp, 2, -m, 4096M, -qmp, stdio, -chardev, null,id=char0, -serial, chardev:char0, -nographic, -cdrom, /var/root/Library/Application Support/multipassd/qemu/vault/instances/dbarn/cloud-init-config.iso'
[2022-01-04T13:43:17.004] [debug] [qemu-system-aarch64] [1384] started: qemu-system-aarch64 -machine virt,highmem=off -nographic -dump-vmstate /private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/multipassd.pRWjeY
[2022-01-04T13:43:17.061] [info] [dbarn] process state changed to Starting
[2022-01-04T13:43:17.063] [info] [dbarn] process state changed to Running
[2022-01-04T13:43:17.063] [debug] [qemu-system-aarch64] [1385] 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=52:54:00:11:ff:d3 -cpu cortex-a72 -device virtio-scsi-pci,id=scsi0 -drive file=/var/root/Library/Application Support/multipassd/qemu/vault/instances/dbarn/ubuntu-20.04-server-cloudimg-arm64.img,if=none,format=qcow2,discard=unmap,id=hda -device scsi-hd,drive=hda,bus=scsi0.0 -smp 2 -m 4096M -qmp stdio -chardev null,id=char0 -serial chardev:char0 -nographic -cdrom /var/root/Library/Application Support/multipassd/qemu/vault/instances/dbarn/cloud-init-config.iso
[2022-01-04T13:43:17.063] [info] [dbarn] process started
[2022-01-04T13:43:17.063] [debug] [dbarn] Waiting for SSH to be up
[2022-01-04T13:43:17.347] [warning] [dbarn] qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:11:ff:d3: info: Started vmnet interface with configuration:
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:11:ff:d3: info: MTU:              1500
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:11:ff:d3: info: Max packet size:  1514
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:11:ff:d3: info: MAC:              de:e5:9b:47:58:c4
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:11:ff:d3: info: DHCP IPv4 start:  192.168.64.1
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:11:ff:d3: info: DHCP IPv4 end:    192.168.64.254
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:11:ff:d3: info: IPv4 subnet mask: 255.255.255.0
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:11:ff:d3: info: UUID:             9736AE0D-0FAE-4223-847E-517E35533FEA

[2022-01-04T13:43:17.348] [warning] [qemu-system-aarch64] 
[2022-01-04T13:43:17.351] [debug] [dbarn] QMP: {"QMP": {"version": {"qemu": {"micro": 0, "minor": 1, "major": 6}, "package": ""}, "capabilities": ["oob"]}}

[2022-01-04T13:43:17.399] [debug] [dbarn] QMP: {"return": {}}

[2022-01-04T13:43:29.746] [debug] [dbarn] QMP: {"timestamp": {"seconds": 1641321809, "microseconds": 746100}, "event": "NIC_RX_FILTER_CHANGED", "data": {"path": "/machine/unattached/device[7]/virtio-backend"}}
@milopersic milopersic added the bug label Jan 4, 2022
@townsend2010
Copy link
Contributor

Hey @milopersic,

It's not clear to me at all why qemu crashes, but it looks like it does start again to the point where the instance's virtual network adapter comes up. If you don't mind, could you post the contents of /var/db/dhcpd_leases?

@milopersic
Copy link
Author

milopersic commented Jan 4, 2022

Sure thing, thank you. This shows some of the other instances I created previously on the first installation of multipass. For what it's worth, I get "status unknown" on my instances after attempting a restart.

image

/var/db/dhcpd_leases below: (I'm assuming you wanted these from my host machine, the M1 mac)


        lease=0x61c9185c
}
{
        name=primary
        ip_address=192.168.64.6
        hw_address=1,52:54:0:9c:22:d7
        identifier=1,52:54:0:9c:22:d7
        lease=0x61c92dad
}
{
        name=dbarn
        ip_address=192.168.64.5
        hw_address=1,52:54:0:3b:85:37
        identifier=1,52:54:0:3b:85:37
        lease=0x61c77a3e
}
{
        name=tractorgeeks
        ip_address=192.168.64.4
        hw_address=1,52:54:0:1:e7:ff
        identifier=1,52:54:0:1:e7:ff
        lease=0x61b96210
}
{
        name=primary
        ip_address=192.168.64.3
        hw_address=1,52:54:0:5f:52:7a
        identifier=1,52:54:0:5f:52:7a
        lease=0x61c77eb3
}
{
        name=linus
        ip_address=192.168.64.2
        hw_address=1,52:54:0:2a:54:84
        identifier=1,52:54:0:2a:54:84
        lease=0x61a586f2
}

@townsend2010
Copy link
Contributor

Is that the full file contents? I ask because the top of what you posted looks wrong, ie, the

        lease=0x61c9185c
}

is a dangling entry and shows a corrupted leases file. Multipass only opens this file read-only, so if this is the case, then something in macOS is corrupting this file and causing us issues. If those two lines are truly like that in your file, please remove those two lines only and try again.

@milopersic
Copy link
Author

milopersic commented Jan 4, 2022

My mistake, apologies! I didn't post the full file. Repost:

{
        name=tractorgeeks
        ip_address=192.168.64.12
        hw_address=1,52:54:0:db:19:c3
        identifier=1,52:54:0:db:19:c3
        lease=0x61d471ba
}
{
        name=dbarn
        ip_address=192.168.64.11
        hw_address=1,52:54:0:11:ff:d3
        identifier=1,52:54:0:11:ff:d3
        lease=0x61d54fea
}
{
        name=elon
        ip_address=192.168.64.10
        hw_address=1,52:54:0:76:78:7a
        identifier=1,52:54:0:76:78:7a
        lease=0x61c92fc4
}
{
        name=assuring-quetzal
        ip_address=192.168.64.9
        hw_address=1,52:54:0:3:b1:2f
        identifier=1,52:54:0:3:b1:2f
        lease=0x61c92e03
}
{
        name=profound-admiral
        ip_address=192.168.64.8
        hw_address=1,52:54:0:94:1b:4e
        identifier=1,52:54:0:94:1b:4e
        lease=0x61ca7da5
}
{
        name=venom
        ip_address=192.168.64.7
        hw_address=1,52:54:0:a7:65:ce
        identifier=1,52:54:0:a7:65:ce
        lease=0x61c9185c
}
{
        name=primary
        ip_address=192.168.64.6
        hw_address=1,52:54:0:9c:22:d7
        identifier=1,52:54:0:9c:22:d7
        lease=0x61c92dad
}
{
        name=dbarn
        ip_address=192.168.64.5
        hw_address=1,52:54:0:3b:85:37
        identifier=1,52:54:0:3b:85:37
        lease=0x61c77a3e
}
{
        name=tractorgeeks
        ip_address=192.168.64.4
        hw_address=1,52:54:0:1:e7:ff
        identifier=1,52:54:0:1:e7:ff
        lease=0x61b96210
}
{
        name=primary
        ip_address=192.168.64.3
        hw_address=1,52:54:0:5f:52:7a
        identifier=1,52:54:0:5f:52:7a
        lease=0x61c77eb3
}
{
        name=linus
        ip_address=192.168.64.2
        hw_address=1,52:54:0:2a:54:84
        identifier=1,52:54:0:2a:54:84
        lease=0x61a586f2
}

@townsend2010
Copy link
Contributor

Ok, that looks better as far as a corrupted leases file 😉

But gah, stupid Apple's bootp has duplicate entries in the file and past experience shows that if there are entries with the same name, none of the entries work. Please remove any duplicate entries based in the name field and try again and see if that helps.

@milopersic
Copy link
Author

milopersic commented Jan 4, 2022

:) thanks. I'll try it! To be clear, by "duplicates" you mean duplicates by name?

name=linus

No other info is relevant? Wait you just said that. Sorry, long day.

@townsend2010
Copy link
Contributor

Sorry, I mean the whole entry. For example, there are 2 entries for the dbarn instance:

{
        name=dbarn
        ip_address=192.168.64.11
        hw_address=1,52:54:0:11:ff:d3
        identifier=1,52:54:0:11:ff:d3
        lease=0x61d54fea
}

and

{
        name=dbarn
        ip_address=192.168.64.5
        hw_address=1,52:54:0:3b:85:37
        identifier=1,52:54:0:3b:85:37
        lease=0x61c77a3e
}

You will need to remove both of those full entries, from the { to the }.

@milopersic
Copy link
Author

Okay, that helps. The instance you pasted in on top here (ip_address=192.168.64.11) is my latest instance and one that I was using. Can you confirm that I should remove that? What should be kept?

@townsend2010
Copy link
Contributor

townsend2010 commented Jan 4, 2022

Please stop any "running" instances, ie, dbarn and tractorgeeks, remove both of those entries I posted above (and any and all entries that have duplicates), then try starting an instance such as dbarn.

@milopersic
Copy link
Author

Sadly still not able to start the instance. I stopped and exited multipass, edited out the duplicates and both entries for dbarn, restarted multipass, and attempted to restart dbarn:

start failed: The following errors occurred:                                    
dbarn: timed out waiting for response
                                                                                
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

At present, my dhcpd_leases file only has "primary" in it, which also does not start.


{
        name=primary
        ip_address=192.168.64.6
        hw_address=1,52:54:0:9c:22:d7
        identifier=1,52:54:0:9c:22:d7
        lease=0x61c92dad
}

Here are the latest logs (I think I'm going far back enough but let me know):

[2022-01-04T15:06:32.834] [warning] [qemu-system-aarch64] 
[2022-01-04T15:06:32.835] [debug] [dbarn] QMP: {"QMP": {"version": {"qemu": {"micro": 0, "minor": 1, "major": 6}, "package": ""}, "capabilities": ["oob"]}}

[2022-01-04T15:06:32.862] [debug] [dbarn] QMP: {"return": {}}

[2022-01-04T15:06:45.152] [debug] [dbarn] QMP: {"timestamp": {"seconds": 1641326805, "microseconds": 152154}, "event": "NIC_RX_FILTER_CHANGED", "data": {"path": "/machine/unattached/device[7]/virtio-backend"}}

[2022-01-04T15:07:53.361] [debug] [primary] process working dir ''
[2022-01-04T15:07:53.361] [info] [primary] process program 'qemu-system-aarch64'
[2022-01-04T15:07:53.361] [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=52:54:00:9c:22:d7, -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, 1, -m, 1024M, -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'
[2022-01-04T15:07:53.367] [debug] [qemu-system-aarch64] [2165] started: qemu-system-aarch64 -machine virt,highmem=off -nographic -dump-vmstate /private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/multipassd.SyUqRM
[2022-01-04T15:07:53.418] [info] [primary] process state changed to Starting
[2022-01-04T15:07:53.420] [info] [primary] process state changed to Running
[2022-01-04T15:07:53.420] [debug] [qemu-system-aarch64] [2166] 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=52:54:00:9c:22:d7 -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 1 -m 1024M -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
[2022-01-04T15:07:53.420] [info] [primary] process started
[2022-01-04T15:07:53.420] [debug] [primary] Waiting for SSH to be up
[2022-01-04T15:07:53.460] [warning] [primary] qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:9c:22:d7: info: Started vmnet interface with configuration:
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:9c:22:d7: info: MTU:              1500
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:9c:22:d7: info: Max packet size:  1514
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:9c:22:d7: info: MAC:              a2:be:ac:c6:8b:70
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:9c:22:d7: info: DHCP IPv4 start:  192.168.64.1
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:9c:22:d7: info: DHCP IPv4 end:    192.168.64.254
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:9c:22:d7: info: IPv4 subnet mask: 255.255.255.0
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:9c:22:d7: info: UUID:             B4D9E973-5B01-40FF-AB23-95BC5CC96C22

[2022-01-04T15:07:53.460] [warning] [qemu-system-aarch64] 
[2022-01-04T15:07:53.460] [debug] [primary] QMP: {"QMP": {"version": {"qemu": {"micro": 0, "minor": 1, "major": 6}, "package": ""}, "capabilities": ["oob"]}}

[2022-01-04T15:07:53.479] [debug] [primary] QMP: {"return": {}}

[2022-01-04T15:08:05.750] [debug] [primary] QMP: {"timestamp": {"seconds": 1641326885, "microseconds": 750253}, "event": "NIC_RX_FILTER_CHANGED", "data": {"path": "/machine/unattached/device[6]/virtio-backend"}}

@townsend2010
Copy link
Contributor

Ok, I'm betting the bootp has some entries cached in memory. The easiest way to clear that up is to restart the machine. Please let me know if that is not possible. Sorry for all of the headaches with this ☹️

@milopersic
Copy link
Author

Hey Chris, can't tell you how much I appreciate the help. I can get a reboot in. I'll do that now and retry starting the instance(s) and let you know what happens.

@milopersic
Copy link
Author

Well, no luck after a restart:

start failed: The following errors occurred:                                    
dbarn: timed out waiting for response
                                                                                
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

@townsend2010
Copy link
Contributor

Ugh, and the dhcpd_leases file shows nothing for dbarn still?

Also, let's see if starting it by hand in a terminal will work. Try

$ sudo /Library/Application\ Support/com.canonical.multipass/bin/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=52:54:00:11:ff:d3 -cpu cortex-a72 -device virtio-scsi-pci,id=scsi0 -drive file=/var/root/Library/Application\ Support/multipassd/qemu/vault/instances/dbarn/ubuntu-20.04-server-cloudimg-arm64.img,if=none,format=qcow2,discard=unmap,id=hda -device scsi-hd,drive=hda,bus=scsi0.0 -smp 1 -m 1024M -qmp stdio -chardev null,id=char0 -serial chardev:char0 -cdrom /var/root/Library/Application\ Support/multipassd/qemu/vault/instances/dbarn/cloud-init-config.iso

I tried to escape spaces in the paths, but you may have to play around with those. In theory, this should open a QEMU window and you should be able to observe the boot process and see if there are any errors or that the instance is getting stuck booting.

@milopersic
Copy link
Author

I think you escaped it correctly because no error was thrown in the terminal. However it launched a QEMU terminal window and locked my cursor. Tried alt+cmd+G (as indicated) and no luck. Also experienced some UI glitches. Had to perform two successive hard resets to get my input ability back. Weird stuff! After coming back up, I tried starting dbarn again via the menu bar app. No luck, still times out. Anything else I should try?

@townsend2010
Copy link
Contributor

townsend2010 commented Jan 4, 2022

Oh, good grief! Well, when the QEMU window was open, did you happen to see if it booted to a login prompt? Also, do you see a dbarn entry in the dhcpd_leases file?

I'm really running out of ideas here. I'll give it some thought and post anything I can think of tomorrow.

@milopersic
Copy link
Author

I don't recall what was in the terminal. Sounds like a plan, thanks! In the meantime I can spool up a remote dev environment on my server and keep on truckin' with that.

@ymka
Copy link

ymka commented Jan 5, 2022

Hi guys,
I've faced the same issue.
Try to disable macos firewall.

@milopersic
Copy link
Author

milopersic commented Jan 5, 2022

Well what do you know. Completely disabling the firewall on macOS actually worked and I was able to start my instances normally. I didn't think this was the problem, as you can see I'm not blocking all incoming connections and I have checked "automatically allow built-in software to receive incoming connections" (I guess Multipass is not treated as built-in software?).

image

Canonical's troubleshooting page mentions that if the firewall is enabled, it should not "block all incoming connections" so I thought I was good. It does not say the firewall should be fully disabled.

https://multipass.run/docs/troubleshooting-networking-on-macos

Turning off the firewall completely doesn't seem like the ideal solution. I turned my firewall back on and added a rule for Multipass, to Allow all incoming connections. This did not work! Even with that rule the instances do not start. I'm nervous about using Multipass if I have to fully disable the firewall, but maybe I'm wrong.

@townsend2010
Copy link
Contributor

Hi @milopersic,

Glad you've made some progress on diagnosing what the problem is! Our guide is based more on macOS 10.x and it appears there have been changes surrounding the firewall in newer versions of macOS. I don't have a M1-based Mac at my disposal, but I do have an Intel Mac and will try to see if I can reproduce this and if so, determine what can be done aside from completely disabling the firewall. I agree, that is not an ideal solution.

@milopersic
Copy link
Author

Thank you @townsend2010 ! M1 is still very new and we're all figuring out the quirks. Good luck on researching the issue and fix. If I can assist you by trying anything let me know. Multipass is an amazing application and this is just a bump in the road.

@townsend2010
Copy link
Contributor

Thanks for the kind words @milopersic 🙂 I'll definitely let you know if I find anything.

@milopersic
Copy link
Author

milopersic commented Jan 5, 2022

Awesome! For what it's worth, I'll recap or add a few facts re: my experience in case any of this is relevant:

  • Multipass did work for me initially with the firewall enabled.
  • After some time, around a few days, it would fail to start. Pretty odd.
  • Wiping it and reinstalling it (and rebuilding my VMs, grunt) fixed the issue... for another few days.
  • Failure was characterized by a full system crash (not just the application) and a very hot (for M1) computer.
  • Restarting after a system crash has given me a Multipass that still works but only if the firewall is fully disabled.
  • Adding a rule for Multipass did not allow the firewall to be enabled AND multipass to start.
  • Once again, I am using multipass 1.8.1+mac, multipassd 1.8.1+mac. (multipass --version), on macOS Monterey 12.1, M1 Max, with 32 GB RAM.
  • I have no VPN software installed, if relevant.
  • I use the multipass VMs for python, posgresql, postgis, and several gis-related libraries, nothing weird.
  • I SSH into my Multipass instances via VSCode, which works brilliantly.
  • I create my instances like so: multipass launch --disk 10G --mem 4G --cpus 2 --name <instance_name>
  • I set up swap memory like so: sudo fallocate -l 2G /swapfile, etc...

What's confusing to me is why it would work at all for any length of time if the firewall is the issue, but who knows what macOS is doing under the hood.

@townsend2010
Copy link
Contributor

Great summary @milopersic!

The macOS networking is certainly mysterious. I suppose no updates to Monterey happened around the time the firewall began to cause Multipass issues, right?

@milopersic
Copy link
Author

You know, MacOS 12.1 was released December 13, 2021. I don't recall the exact day I had the first crash but it may well have been right after the update.

@townsend2010
Copy link
Contributor

Ok, good to know. I'm updating my Intel Mac to 12.1. We'll see what happens 😉

@rjoelnorgren
Copy link

I would like to add I am also using a similar set up (M1 Pro, Monterey 12.0.1) and have encountered today what I believe is the same issue as @milopersic. Unfortunately this is a company issued machine that I do not have privileges to disable the firewall on. Brief description below and logs similar to what has already been reported follow:

Last night I had Multipass working just fine. Today after rebooting my machine my VMs failed to start. I tried clearing out entries for my VMs from /var/db/dhcpd_leases, but the issue persisted. After a full uninstall/reboot/install of Multipass, I could once again launch and run VMs. However, it seems that if I shutdown/restart my machine, my Multipass fails to launch new or start existing images:

rnorgren@Robins-MBP:~$ multipass launch -c 4 -m 8G -d 10G -n dev --cloud-init ~/multipass/localdev/cloud-init.yaml 
launch failed: The following errors occurred:                                   
dev: timed out waiting for response

I also confirmed a simple multipass launch will also fail. Logs from the above:

multipassd.log

2022-01-07T17:17:39.316] [info] [dev] VM shut down
[2022-01-07T17:17:39.323] [info] [dev] process state changed to NotRunning
[2022-01-07T17:17:39.323] [info] [dev] process finished with exit code 0
[2022-01-07T17:18:29.454] [debug] [update] Latest Multipass release available is version 1.8.0
[2022-01-07T17:18:31.478] [info] [VMImageHost] Did not find any supported products in "appliance"
[2022-01-07T17:18:31.504] [info] [rpc] gRPC listening on unix:/var/run/multipass_socket, SSL:on
[2022-01-07T17:18:31.515] [debug] [qemu-img] [786] started: qemu-img snapshot -l /var/root/Library/Application Support/multipassd/qemu/vault/instances/dev/ubuntu-20.04-server-cloudimg-arm64.img
[2022-01-07T17:18:31.762] [info] [daemon] dev needs starting. Starting now...
[2022-01-07T17:18:31.766] [info] [daemon] Starting Multipass 1.8.1+mac
[2022-01-07T17:18:31.766] [info] [daemon] Daemon arguments: /Library/Application Support/com.canonical.multipass/bin/multipassd --verbosity debug
[2022-01-07T17:18:31.767] [debug] [dev] process working dir ''
[2022-01-07T17:18:31.767] [info] [dev] process program 'qemu-system-aarch64'
[2022-01-07T17:18:31.768] [info] [dev] 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=52:54:00:4a:29:43, -cpu, cortex-a72, -device, virtio-scsi-pci,id=scsi0, -drive, file=/var/root/Library/Application Support/multipassd/qemu/vault/instances/dev/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, 8192M, -qmp, stdio, -chardev, null,id=char0, -serial, chardev:char0, -nographic, -cdrom, /var/root/Library/Application Support/multipassd/qemu/vault/instances/dev/cloud-init-config.iso'
[2022-01-07T17:18:31.832] [debug] [qemu-system-aarch64] [788] started: qemu-system-aarch64 -machine virt,highmem=off -nographic -dump-vmstate /private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/multipassd.FtQGae
[2022-01-07T17:18:32.513] [info] [dev] process state changed to Starting
[2022-01-07T17:18:32.544] [info] [dev] process state changed to Running
[2022-01-07T17:18:32.544] [debug] [qemu-system-aarch64] [793] 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=52:54:00:4a:29:43 -cpu cortex-a72 -device virtio-scsi-pci,id=scsi0 -drive file=/var/root/Library/Application Support/multipassd/qemu/vault/instances/dev/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 8192M -qmp stdio -chardev null,id=char0 -serial chardev:char0 -nographic -cdrom /var/root/Library/Application Support/multipassd/qemu/vault/instances/dev/cloud-init-config.iso
[2022-01-07T17:18:32.545] [info] [dev] process started
[2022-01-07T17:18:32.547] [debug] [dev] Waiting for SSH to be up
[2022-01-07T17:18:32.963] [warning] [dev] qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:4a:29:43: info: Started vmnet interface with configuration:
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:4a:29:43: info: MTU:              1500
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:4a:29:43: info: Max packet size:  1514
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:4a:29:43: info: MAC:              ae:47:28:c2:2b:e4
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:4a:29:43: info: DHCP IPv4 start:  192.168.64.1
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:4a:29:43: info: DHCP IPv4 end:    192.168.64.254
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:4a:29:43: info: IPv4 subnet mask: 255.255.255.0
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:4a:29:43: info: UUID:             19EE9E04-2641-4575-BA4E-C06F654CA7DA

[2022-01-07T17:18:32.963] [warning] [qemu-system-aarch64] 
[2022-01-07T17:18:32.964] [debug] [dev] QMP: {"QMP": {"version": {"qemu": {"micro": 0, "minor": 1, "major": 6}, "package": ""}, "capabilities": ["oob"]}}

[2022-01-07T17:18:33.015] [debug] [dev] QMP: {"return": {}}

[2022-01-07T17:18:46.323] [debug] [dev] QMP: {"timestamp": {"seconds": 1641604726, "microseconds": 323225}, "event": "NIC_RX_FILTER_CHANGED", "data": {"path": "/machine/unattached/device[9]/virtio-backend"}}

@morphologue
Copy link

morphologue commented Jan 18, 2022

I'm in the same situation as @rjoelnorgren (work laptop) but I have been able to work around this by adding the following from /Library/Application Support/com.canonical.multipass/bin/multipass to my firewall settings:
image
I'm not sure which one did the trick but at least I can get on with my day now :)

@rjoelnorgren
Copy link

@morphologue, thank you for the suggestion. Unfortunately that did not resolve the issue on my end.

@dijitali
Copy link

@ricab - annoyingly, that reporting process seems to require you to be on the a beta program to submit feedback. I can run the Feedback Assistant app but not submit anything. If there is a way to enroll in the MacOS beta program, I probably wouldn't be able to on my primary work device.

I want to check I'm experiencing the same issue because unfortunately none of the steps mentioned here seem to resolve the problem at the moment.

I'm still experiencing this on MacOS Sonoma 14.1.1 (23B81), Multipass 1.12.2+mac with:

  1. Firewall active but "Block all incoming connections" disabled
  2. Exclusions for com.apple.bootpd because the firewall is managed via an MDM policy so is not configurable via socketfilterfw (not sure if this is actually necessary if incoming connections are not blocked)
  3. duplicate entries in /var/db/dhcpd_leases removed, then Multipass exited and all QEMU processes killed
  4. Ran default Onyx maintenance tasks and rebooted MacBook

And I get this timeout starting instances:

 ~ multipass list
Name                    State             IPv4             Image
primary                 Stopped           --               Ubuntu 22.04 LTS

~ multipass start primary
Starting primary \
start failed: The following errors occurred:
primary: timed out waiting for response

 ~ multipass list
Name                    State             IPv4             Image
primary                 Unknown           --               Ubuntu 22.04 LTS

And in /Library/Logs/Multipass/multipassd.log I have:

...
[2023-11-29T11:37:17.549] [debug] [primary] process working dir ''
[2023-11-29T11:37:17.549] [info] [primary] process program 'qemu-system-aarch64'
[2023-11-29T11:37:17.549] [info] [primary] process arguments '-machine, virt,gic-version=3, -accel, hvf, -drive, file=/Library/Application Support/com.canonical.multipass/bin/../Resources/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on, -cpu, host, -nic, vmnet-shared,model=virtio-net-pci,mac=52:54:00:0b:57:81, -device, virtio-scsi-pci,id=scsi0, -drive, file=/var/root/Library/Application Support/multipassd/qemu/vault/instances/primary/ubuntu-22.04-server-cloudimg-arm64.img,if=none,format=qcow2,discard=unmap,id=hda, -device, scsi-hd,drive=hda,bus=scsi0.0, -smp, 1, -m, 1024M, -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'
[2023-11-29T11:37:17.560] [debug] [qemu-system-aarch64] [1449] started: qemu-system-aarch64 -machine virt,gic-version=3 -nographic -dump-vmstate /private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/multipassd.hjshOm
[2023-11-29T11:37:17.757] [info] [primary] process state changed to Starting
[2023-11-29T11:37:17.760] [info] [primary] process state changed to Running
[2023-11-29T11:37:17.760] [debug] [qemu-system-aarch64] [1450] started: qemu-system-aarch64 -machine virt,gic-version=3 -accel hvf -drive file=/Library/Application Support/com.canonical.multipass/bin/../Resources/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on -cpu host -nic vmnet-shared,model=virtio-net-pci,mac=52:54:00:0b:57:81 -device virtio-scsi-pci,id=scsi0 -drive file=/var/root/Library/Application Support/multipassd/qemu/vault/instances/primary/ubuntu-22.04-server-cloudimg-arm64.img,if=none,format=qcow2,discard=unmap,id=hda -device scsi-hd,drive=hda,bus=scsi0.0 -smp 1 -m 1024M -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
[2023-11-29T11:37:17.760] [info] [primary] process started
[2023-11-29T11:37:17.766] [debug] [primary] Waiting for SSH to be up
[2023-11-29T11:37:18.774] [debug] [primary] QMP: {"QMP": {"version": {"qemu": {"micro": 0, "minor": 0, "major": 8}, "package": ""}, "capabilities": ["oob"]}}

[2023-11-29T11:37:18.808] [debug] [primary] QMP: {"return": {}}

[2023-11-29T11:37:32.175] [debug] [primary] QMP: {"timestamp": {"seconds": 1701211052, "microseconds": 175712}, "event": "NIC_RX_FILTER_CHANGED", "data": {"path": "/machine/unattached/device[6]/virtio-backend"}}

@AravindGopala
Copy link

AravindGopala commented Nov 29, 2023

FYI, I have much success by running the below commands for the bootpd to start dhcp leases to work.

I have to run once per boot to fix my dhcp leasing. The issue is more prominent when the internet sharing is enabled for me. This is definitely not a permanent solution, but a temporary work around, I am running Sonoma, M1 Max.

        sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/libexec/bootpd
        sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblock /usr/libexec/bootpd

Hope it helps.

@dijitali
Copy link

Unfortunately my MacBook has the firewall enabled via an MDM profile so those commands give this error:

~ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblock /usr/libexec/bootpd
Firewall settings cannot be modified from command line on managed Mac computers.

The firewall isn't currently set to block incoming connections and I also excluded bootpd in the profile though, as suggested in lima-vm/socket_vmnet#18 (comment):

<dict>
  <key>ProfileDescription</key>
  <string>The configuration profile enables your company’s technical support to enforce security policies on your mobile device</string>
  <key>ProfileDisplayName</key>
  <string>Firewall Profile</string>
  <key>ProfileIdentifier</key>
  <string>www.windowsintune.com.security.firewall</string>
  <key>ProfileInstallDate</key>
  <string>2023-11-02 20:49:03 +0000</string>
  <key>ProfileItems</key>
  <array>
    <dict>
      <key>PayloadContent</key>
      <dict>
        <key>Applications</key>
        <array>
          <dict>
            <key>Allowed</key>
            <true/>
            <key>BundleID</key>
            <string>com.apple.bootpd</string>
          </dict>
        </array>
        <key>EnableFirewall</key>
        <true/>
      </dict>
      <key>PayloadDisplayName</key>
      <string>Firewall Profile</string>
      <key>PayloadIdentifier</key>
      <string>www.windowsintune.com.security.firewall.payload</string>
      <key>PayloadOrganization</key>
      <string>ORG</string>
      <key>PayloadType</key>
      <string>com.apple.security.firewall</string>
      <key>PayloadUUID</key>
      <string>ef5ef3d1-a3bf-465a-b887-885f78367e39</string>
      <key>PayloadVersion</key>
      <integer>1</integer>
    </dict>
  </array>
  <key>ProfileOrganization</key>
  <string>ORG</string>
  <key>ProfileRemovalDisallowed</key>
  <string>true</string>
  <key>ProfileType</key>
  <string>Configuration</string>
  <key>ProfileUUID</key>
  <string>7863fde5-8080-423e-a20d-3e365970ee2b</string>
  <key>ProfileVerificationState</key>
  <string>verified</string>
  <key>ProfileVersion</key>
  <integer>1</integer>
</dict>

Which at least shows up in the Firewall UI OK:
image

@yossicohn-hs
Copy link

I'm in the same situation as @rjoelnorgren (work laptop) but I have been able to work around this by adding the following from /Library/Application Support/com.canonical.multipass/bin/multipass to my firewall settings: image I'm not sure which one did the trick but at least I can get on with my day now :)

I added multipass and actually the qemu as well to the firewall "allow incoming" and it worked

@lethargosapatheia
Copy link

lethargosapatheia commented Jan 18, 2024

@yossicohn-hs Make sure this didn't happen because of restart or something like that. You'd know 100% that it works if it starts working the moment you've added the firewall rules and not after rebooting. When restarting, multipass might work without making any changes. It's happened to me over and over.

@owainkenwayucl
Copy link

owainkenwayucl commented Jan 26, 2024

I found this whole thread helpful actually - I think that the reason this appears random is due to the GUI for the firewall in MacOS not accurately representing the state of the firewall - specifically, if you change settings on the dialog that pops up when you click "Options..." they will apparently not be applied until the firewall re-loads settings (which happens on a proper (important!) reboot).

In my instance, here is the sequence of events.

Last week I was feeling a bit paranoid and so took a pass through the Firewall settings on my work Mac and noticed that while the Firewall was "turned on" which "enables built-in software" and "signed software" to receive connections. This is different from the default configuration on my Linux machines which is to block all incoming connections so I changed it to "Block all incoming connections".

I figured this might break Multipass so after doing this I immediately started a couple of my Multipass instances and they were fine so I figured something like "huh, it's clever enough to know not to apply firewall rules to the virtual interfaces - nice!".

On Monday this week, I applied the 14.3 update which of course rebooted my Mac, but it did so in the weird "not-quite-entire-reboot" way that software updates do (I've previously noticed that software update reboots are different from "real" reboots and various things persist but not had time or cared enough to investigate further).

Today, before an important meeting (of course) I did my usual "brew update" and this updated the Wacom tablet drivers. Because they are a cask, they don't... like that very much and usually rebooting fixes it. It fixed the tablet, but immediately broke multipass.

I tried all sorts of things before I found this thread (rebooting, removing and reinstalling multipass, removing the tablet drivers...)- even changing the firewall settings in the GUI to no avail, until someone further up suggested rebooting after changing the settings. And indeed, with further testing it looks like changes to settings you make in the GUI under "Options..." do not immediately take effect.

This is quite bad for all sorts of reasons, for example, I thought for about a week that my firewall had a "higher level" of protection than it actually had, but also makes the behaviour here seem random when in actual fact, it's just "delayed".

Hope this helps someone.

@joe-boylson
Copy link

@milopersic Dude you're a lifesaver. Totally bewildered why multipass was not working after I had just used it yesterday - and now I'm back on track.

@svandenhoek
Copy link

svandenhoek commented Apr 16, 2024

Just adding this here in case it might be useful to someone. Ran into the same issue and for now the following ended up working for me (for now) it just stopped working moments after posting this...:

MacOS version: 14.4.1

Setting name enabled/disabled
Block all incoming connections disabled
Automatically allow built-in software to receive incoming connections disabled
Automatically allow downloaded signed software to receive incoming connections disabled
Enable stealth mode disabled

Allow the following:

  • bootpd
  • launchd
  • multipassd

After multiple times turning off & on the system it seemed to stay working yesterday (and still does today). Fingers crossed it stays this way.

EDIT: Testing if it worked was done AFTER the first "turning it off and on again". Also note that the Macbook was turned off & on, not restarted.

EDIT2: It stopped working again... very weird...

@AravindGopala
Copy link

Hi @svandenhoek for me even after disabling firewall as you mentioned above, i have to run these commands still after a bootup/reboot for inorder it to work, may be worth a try:

        sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/libexec/bootpd
        sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblock /usr/libexec/bootpd

@svandenhoek
Copy link

@AravindGopala even after disabling the firewall?! Seems there's some very weird behaviour going on. For me running sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblock /usr/libexec/bootpd did end up making it work again (even though it was still allowed in the Settings UI), though I can't seem to reproduce the issue & test this as I have turned off and on my system multiple times since then but (for now) it seems to keep working (without needing to run that command again).

Next time it occurs I'll just try running that again and if it indeed fixes it consistently will either just create an alias or some script that runs during startup.

@kilianc
Copy link

kilianc commented Apr 18, 2024

I have this issue as well

[2024-04-18T10:51:37.471] [info] [peaceful-kit] process state changed to Starting
[2024-04-18T10:51:37.473] [info] [peaceful-kit] process state changed to Running
[2024-04-18T10:51:37.473] [debug] [qemu-system-aarch64] [37041] started: qemu-system-aarch64 -machine virt,gic-version=3 -accel hvf -drive file=/Library/Application Support/com.canonical.multipass/bin/../Resources/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on -cpu host -nic vmnet-shared,model=virtio-net-pci,mac=52:54:00:ec:33:c3 -device virtio-scsi-pci,id=scsi0 -drive file=/var/root/Library/Application Support/multipassd/qemu/vault/instances/peaceful-kit/ubuntu-22.04-server-cloudimg-arm64.img,if=none,format=qcow2,discard=unmap,id=hda -device scsi-hd,drive=hda,bus=scsi0.0 -smp 1 -m 1024M -qmp stdio -chardev null,id=char0 -serial chardev:char0 -nographic -cdrom /var/root/Library/Application Support/multipassd/qemu/vault/instances/peaceful-kit/cloud-init-config.iso
[2024-04-18T10:51:37.473] [info] [peaceful-kit] process started
[2024-04-18T10:51:37.474] [debug] [peaceful-kit] Waiting for SSH to be up
[2024-04-18T10:51:37.526] [debug] [peaceful-kit] QMP: {"QMP": {"version": {"qemu": {"micro": 1, "minor": 2, "major": 8}, "package": ""}, "capabilities": ["oob"]}}
[2024-04-18T10:51:37.542] [debug] [peaceful-kit] QMP: {"return": {}}
[2024-04-18T10:51:51.419] [debug] [peaceful-kit] QMP: {"timestamp": {"seconds": 1713462711, "microseconds": 419145}, "event": "NIC_RX_FILTER_CHANGED", "data": {"path": "/machine/unattached/device[6]/virtio-backend"}}

Will running these commands one-off fix the issue, or does this need to happen every time at startup?

sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/libexec/bootpd
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblock /usr/libexec/bootpd

I am on macOS 14.4.1 and my laptop is managed by IT. I can have them run the commands once but I can't have this done on each reboot.

@BainMcKay
Copy link

BainMcKay commented Apr 18, 2024

What the above commands do, is register bootpd with the firewall and unblock it. You only need to do it once.

That did not help me. I need to find a way to get my instances to listen to me. But its complains about network timeouts, which appear to be SSH is not up (which it is). This means incompatible network apparently. New instances created in this release work well. I had updated to the latest release. Which jumped a couple of releases. Seems network configuration might have changed enough but can't recover without manual edits. Any guidance someone can provide is appreciated. I mostly rebuilt my Instances and rewote the code, but I'd like to recover the old Instances. if nothing else, it provides less of a feeling that I am living on a knife's edge using Multipass. I love the product. Hate the risk.

@kilianc
Copy link

kilianc commented Apr 18, 2024

The interesting thing is that the person next to me is using 14.4.1 with the same firewall settings and it works for them.

@BainMcKay
Copy link

BainMcKay commented Apr 19, 2024

Some clarification is required. Any Instances created with this release seem solid. It's those created in a prior release I could not open as soon as the update took place. They were always solid, until the update. And then no network. Can't be opened.

I did create a test instance in the new release which worked, after which I added to (192.168.64.X.) a Bridge network (10.0.1.X), since I had a similar Bridge network before. 10 is the gateway IP. When Test instance lot its 10 IP, I can get into Test with 192. But not the VMs form a prior Multipass release - they have lots of config and code. And while I have a backup image, it doesn't work so no value either - no network, so I'm stuck with dead dev VMs .

And I should also add, I am aware of MacOS Firewall opaque behaviour. I run into them in dev as well. So I get that part. But I am surprised there is no way to open up these perfectly good VM instances. That's the knife edge. It can happen again, and that is unsettling. So recovering these VMs, is a bit of insurance on future failures.

@ricab
Copy link
Collaborator

ricab commented Apr 19, 2024

Hi @BainMcKay, if you can start some VMs but not others your problems are unrelated to the firewall. The symptoms you report can have different causes, some of them recoverable, some not so much. This thread is quite long as it is so let's continue discussing in the issue you've already opened. Please allow us a little time to reply. Thank you.

@BainMcKay
Copy link

BainMcKay commented Apr 19, 2024 via email

@kilianc
Copy link

kilianc commented Apr 21, 2024

I was able to disable the firewall with IT on Friday to A/B test this and I can confirm this solves the problem. I was not able to re-enable the firewall and add specific rules. If anyone can document exactly what multipass/qemu needs we can probably add this to the docs while a fix is found.

I am available to test this if anyone has ideas, what I am trying right now is this.

❯ /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/libexec/bootpd
Application at path ( /usr/libexec/bootpd ) added to firewall

❯ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblock /usr/libexec/bootpd
The application is not part of the firewall

P.S. https://skowronski.tech/posts/2023-01-30-macos-application-firewall-and-multipass-debugging/

@kilianc
Copy link

kilianc commented Apr 21, 2024

Ok. Got Something.

#!/bin/bash

set -e

COUNTER=1

while true; do
  echo ""
  echo "set firewall ran $COUNTER times"
  sudo /usr/libexec/ApplicationFirewall/socketfilterfw     --add /usr/libexec/bootpd
  sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblock /usr/libexec/bootpd
  COUNTER=$((COUNTER+1))
  sleep 5
done

Edit: I updated the script with a counter, the logs below don't match but they represent what I ran on my machine

❯ ./firewall.sh

set firewall
Application at path ( /usr/libexec/bootpd ) added to firewall # <<<<< Added Rule
Incoming connection to the application is permitted

set firewall
The application is already a part of the firewall
Incoming connection to the application is permitted

set firewall
The application is already a part of the firewall
Incoming connection to the application is permitted

set firewall
The application is already a part of the firewall
Incoming connection to the application is permitted

set firewall
The application is already a part of the firewall
Incoming connection to the application is permitted

set firewall
The application is already a part of the firewall
Incoming connection to the application is permitted

set firewall
The application is already a part of the firewall
Incoming connection to the application is permitted

set firewall
The application is already a part of the firewall
Incoming connection to the application is permitted

set firewall
The application is already a part of the firewall
Incoming connection to the application is permitted

set firewall
The application is already a part of the firewall
Incoming connection to the application is permitted

set firewall
The application is already a part of the firewall
Incoming connection to the application is permitted

set firewall
Application at path ( /usr/libexec/bootpd ) added to firewall. # <<<<< Added Rule again????
Incoming connection to the application is permitted

set firewall
The application is already a part of the firewall
Incoming connection to the application is permitted

set firewall
The application is already a part of the firewall
Incoming connection to the application is permitted
^C

Firstly, it doesn't work without sudo. When I use sudo the rule is finally added but magically removed after a while (?!).

... but the mystery continues ...

I had a hunch that keeping the settings window open was racing to write the settings, so I closed it and re-ran the script (the updated version). It ran for few minutes, this time without resetting the rule again, which would validate my hypothesis.

After verifying that launching a new VM worked (YAY), I opened my settings again and found the bootpd entry there for the first time.

image

I hope this helps someone, meanwhile I will keep updating this thread with my findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests