gyf304 / vmcli

A set of utilities (vmcli + vmctl) for macOS Virtualization.framework
BSD 2-Clause "Simplified" License
823 stars 44 forks source link

0.ipaddr is not generated #9

Open hyoo opened 3 years ago

hyoo commented 3 years ago

when i start a vm, it boots up except the SSH server,

[  OK  ] Started Network Name Resolution.
[  OK  ] Reached target Network.
[  OK  ] Reached target Network is Online.
[  OK  ] Reached target Host and Network Name Lookups.
[  OK  ] Reached target Remote File Systems (Pre).
[  OK  ] Reached target Remote File Systems.
         Starting LSB: automatic crash report generation...
         Starting Deferred execution scheduler...
         Starting Availability of block devices...
[  OK  ] Started Regular background program processing daemon.
         Starting Pollinate to seed…udo random number generator...
         Starting Service for snap application lxd.activate...
         Starting Permit User Sessions...
[  OK  ] Finished Remove Stale Onli…ext4 Metadata Check Snapshots.
[  OK  ] Started Deferred execution scheduler.
[  OK  ] Finished Availability of block devices.
[  OK  ] Finished Permit User Sessions.
[  OK  ] Started System Logging Service.
[  OK  ] Finished GRUB failed boot detection.
         Starting Hold until boot process finishes up...
         Starting Terminate Plymouth Boot Screen...
[  OK  ] Finished Hold until boot process finishes up.
[  OK  ] Started Serial Getty on hvc0.
         Starting Set console scheme...
[  OK  ] Finished Terminate Plymouth Boot Screen.
[  OK  ] Started LSB: automatic crash report generation.
[  OK  ] Finished Set console scheme.
[  OK  ] Created slice system-getty.slice.
[  OK  ] Started Getty on tty1.
[  OK  ] Reached target Login Prompts.
[  OK  ] Started LSB: Record successful boot for GRUB.
[  OK  ] Started Login Service.
[  OK  ] Started Unattended Upgrades Shutdown.
         Starting Authorization Manager...
[  OK  ] Started Authorization Manager.
[  OK  ] Started Accounts Service.
[  OK  ] Finished Pollinate to seed…seudo random number generator.
         Starting OpenBSD Secure Shell server...
[FAILED] Failed to start OpenBSD Secure Shell server.
See 'systemctl status ssh.service' for details.
[  OK  ] Started Dispatcher daemon for systemd-networkd.
[  OK  ] Stopped OpenBSD Secure Shell server.
         Starting OpenBSD Secure Shell server...
[FAILED] Failed to start OpenBSD Secure Shell server.
See 'systemctl status ssh.service' for details.
[  OK  ] Stopped OpenBSD Secure Shell server.
         Starting OpenBSD Secure Shell server...
[FAILED] Failed to start OpenBSD Secure Shell server.
See 'systemctl status ssh.service' for details.
[  OK  ] Stopped OpenBSD Secure Shell server.
         Starting OpenBSD Secure Shell server...
[FAILED] Failed to start OpenBSD Secure Shell server.
See 'systemctl status ssh.service' for details.
[  OK  ] Stopped OpenBSD Secure Shell server.
         Starting OpenBSD Secure Shell server...
[FAILED] Failed to start OpenBSD Secure Shell server.
See 'systemctl status ssh.service' for details.
[  OK  ] Started Snap Daemon.
         Starting Wait until snapd is fully seeded...
[  OK  ] Stopped OpenBSD Secure Shell server.
[FAILED] Failed to start OpenBSD Secure Shell server.
See 'systemctl status ssh.service' for details.
[  OK  ] Finished Wait until snapd is fully seeded.
[  OK  ] Finished Service for snap application lxd.activate.
[  OK  ] Reached target Multi-User System.
[  OK  ] Reached target Graphical Interface.
         Starting Update UTMP about System Runlevel Changes...
[  OK  ] Finished Update UTMP about System Runlevel Changes.

Ubuntu 20.04.1 LTS ubuntu hvc0

ubuntu login:

and it seems like 0.macaddr is created, but not 0.ipaddr.

BTW, my internet sharing is already off.

How can i debug further ?

djohnsson commented 3 years ago

I'm not sure if this is the same issue I just ran into, but when I have the built-in firewall turned on I am unable to get a working network connection inside the VM - which took me longer than I would like to admit to find out.

I'm on wi-fi + nat.

ChangheeOh commented 3 years ago

I have successfully run a ubuntu vm by vmctl before upgrade MacOS 11.2.2. After upgrading my MBA to Big Sur 11.2.2, the existing VM can not start with the same status you mentioned.

gyf304 commented 3 years ago

I have successfully run a ubuntu vm by vmctl before upgrade MacOS 11.2.2. After upgrading my MBA to Big Sur 11.2.2, the existing VM can not start with the same status you mentioned.

Is there any error? What does vmctl attach ubuntu show?

ChangheeOh commented 3 years ago

The following is the boot logs. Because the network is not able to be configured, vmctl ip ubuntu also can not show IP address for this VM. I have one more question, can I login directly in attached screen with root id?

[ OK ] Finished Set the console keyboard layout. [ OK ] Started Journal Service. [ OK ] Finished udev Coldplug all Devices. [ OK ] Finished Monitoring of LVM… dmeventd or progress polling. [ OK ] Finished Remount Root and Kernel File Systems. Starting Flush Journal to Persistent Storage... Starting Load/Save Random Seed... Starting Create System Users... Starting udev Wait for Complete Device Initialization... [ OK ] Finished Create System Users. Starting Create Static Device Nodes in /dev... [ OK ] Finished Load/Save Random Seed. [ OK ] Finished Create Static Device Nodes in /dev. Starting udev Kernel Device Manager... [ OK ] Finished Flush Journal to Persistent Storage. [ OK ] Started udev Kernel Device Manager. [ OK ] Started Dispatch Password …ts to Console Directory Watch. [ OK ] Reached target Local Encrypted Volumes. [ OK ] Found device /dev/hvc0. [ OK ] Listening on Load/Save RF …itch Status /dev/rfkill Watch. [ OK ] Finished udev Wait for Complete Device Initialization. Starting Device-Mapper Multipath Device Controller... [ OK ] Started Device-Mapper Multipath Device Controller. [ OK ] Reached target Local File Systems (Pre). Mounting Mount unit for core18, revision 1990... Mounting Mount unit for lxd, revision 19206... Mounting Mount unit for snapd, revision 11043... [ OK ] Mounted Mount unit for core18, revision 1990. [ OK ] Mounted Mount unit for lxd, revision 19206. [ OK ] Mounted Mount unit for snapd, revision 11043. [ OK ] Reached target Local File Systems. Starting Load AppArmor profiles... Starting Set console font and keymap... Starting Create final runt…dir for shutdown pivot root... Starting Initial cloud-init job (pre-networking)... Starting Tell Plymouth To Write Out Runtime Data... Starting Create Volatile Files and Directories... [ OK ] Finished Create final runt…e dir for shutdown pivot root. [ OK ] Finished Set console font and keymap. [ OK ] Finished Tell Plymouth To Write Out Runtime Data. [ OK ] Finished Create Volatile Files and Directories. Starting Network Time Synchronization... Starting Update UTMP about System Boot/Shutdown... [ OK ] Finished Update UTMP about System Boot/Shutdown. [ OK ] Finished Load AppArmor profiles. Starting Load AppArmor pro…managed internally by snapd... [ OK ] Started Network Time Synchronization. [ OK ] Reached target System Time Set. [ OK ] Reached target System Time Synchronized. [ OK ] Finished Load AppArmor pro…s managed internally by snapd. [ 304.922903] cloud-init[571]: Cloud-init v. 20.4.1-0ubuntu1~20.04.1 running 'init-local' at Wed, 01 Apr 2020 17:23:43 +0000. Up 3.61 seconds. [ OK ] Finished Initial cloud-init job (pre-networking). [ OK ] Reached target Network (Pre). Starting Network Service... [ OK ] Started Network Service. Starting Wait for Network to be Configured... Starting Network Name Resolution... [ OK ] Started Network Name Resolution. [ OK ] Reached target Network. [ OK ] Reached target Host and Network Name Lookups. [FAILED] Failed to start Wait for Network to be Configured. See 'systemctl status systemd-networkd-wait-online.service' for details. Starting Initial cloud-ini… (metadata service crawler)... [ 425.388053] cloud-init[641]: Cloud-init v. 20.4.1-0ubuntu1~20.04.1 running 'init' at Wed, 01 Apr 2020 17:30:44 +0000. Up 425.36 seconds.

++++++++++++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++++++++++++

+--------+------+------------------------------+-----------+-------+-------------------+ [ 425.388355] cloud-init[641]: ci-info: | Device | Up | Address | Mask | Scope | Hw-Address |

+--------+------+------------------------------+-----------+-------+-------------------+ [ 425.388508] cloud-init[641]: ci-info: | enp0s1 | True | fe80::acaa:c3ff:fe12:8b04/64 | . | link | ae:aa:c3:12:8b:04 | [ 425.388582] cloud-init[641]: ci-info: | lo | True | 127.0.0.1 | 255.0.0.0 | host | . | [ 425.388655] cloud-init[641]: ci-info: | lo | True | ::1/128 | . | host | . |

+--------+------+------------------------------+-----------+-------+-------------------+ [ 425.388767] cloud-init[641]: ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++

+-------+-------------+---------+-----------+-------+ [ 425.388967] cloud-init[641]: ci-info: | Route | Destination | Gateway | Interface | Flags |

+-------+-------------+---------+-----------+-------+ [ 425.389142] cloud-init[641]: ci-info: | 1 | fe80::/64 | :: | enp0s1 | U | [ 425.389256] cloud-init[641]: ci-info: | 3 | local | :: | enp0s1 | U | [ 425.389317] cloud-init[641]: ci-info: | 4 | ff00::/8 | :: | enp0s1 | U |

+-------+-------------+---------+-----------+-------+ [ 425.389460] cloud-init[641]: 2020-04-01 17:30:44,813 - util.py[WARNING]: No active metadata service found [ OK ] Finished Initial cloud-ini…ob (metadata service crawler). [ OK ] Reached target Cloud-config availability. [ OK ] Reached target Network is Online. [ OK ] Reached target System Initialization. [ OK ] Started Daily apt download activities. [ OK ] Started Daily apt upgrade and clean activities. [ OK ] Started Periodic ext4 Onli…ata Check for All Filesystems. [ OK ] Started Discard unused blocks once a week. [ OK ] Started Refresh fwupd metadata regularly. [ OK ] Started Daily rotation of log files. [ OK ] Started Daily man-db regeneration. [ OK ] Started Message of the Day. [ OK ] Started Daily Cleanup of Temporary Directories. [ OK ] Reached target Paths. [ OK ] Reached target Timers. [ OK ] Listening on D-Bus System Message Bus Socket. [ OK ] Listening on Open-iSCSI iscsid Socket. [ OK ] Listening on Socket unix for snap application lxd.daemon. Starting Socket activation for snappy daemon. [ OK ] Listening on UUID daemon activation socket. [ OK ] Reached target Remote File Systems (Pre). [ OK ] Reached target Remote File Systems. Starting Availability of block devices... [ OK ] Listening on Socket activation for snappy daemon. [ OK ] Reached target Sockets. [ OK ] Reached target Basic System. Starting Accounts Service... Starting LSB: automatic crash report generation... Starting Deferred execution scheduler... [ OK ] Started Regular background program processing daemon. [ OK ] Started D-Bus System Message Bus. [ OK ] Started Save initial kernel messages after boot. Starting Remove Stale Onli…t4 Metadata Check Snapshots... Starting Dispatcher daemon for systemd-networkd... [ OK ] Started Set the CPU Frequency Scaling governor. Starting Pollinate to seed…udo random number generator... Starting System Logging Service... Starting Service for snap application lxd.activate... Starting Snap Daemon... Starting Login Service... Starting Permit User Sessions... [ OK ] Finished Availability of block devices. [ OK ] Started Deferred execution scheduler. [ OK ] Finished Permit User Sessions. Starting Hold until boot process finishes up... Starting Terminate Plymouth Boot Screen... [ OK ] Finished Hold until boot process finishes up. [ OK ] Started Serial Getty on hvc0. Starting Set console scheme... [ OK ] Finished Set console scheme. [ OK ] Created slice system-getty.slice. [ OK ] Started Getty on tty1. [ OK ] Reached target Login Prompts. [ OK ] Finished Terminate Plymouth Boot Screen. [ OK ] Started LSB: automatic crash report generation. [ OK ] Started System Logging Service. [ OK ] Finished Remove Stale Onli…ext4 Metadata Check Snapshots. [ OK ] Started Login Service. [ OK ] Started Unattended Upgrades Shutdown. [ OK ] Started Dispatcher daemon for systemd-networkd. Starting Authorization Manager... [ OK ] Started Authorization Manager. [ OK ] Started Accounts Service. [ OK ] Finished Pollinate to seed…seudo random number generator. Starting OpenBSD Secure Shell server... [ OK ] Started OpenBSD Secure Shell server. [ OK ] Started Snap Daemon. Starting Wait until snapd is fully seeded... [ OK ] Finished Wait until snapd is fully seeded. Starting Apply the settings specified in cloud-config... [ OK ] Finished Service for snap application lxd.activate. [ OK ] Reached target Multi-User System. [ OK ] Reached target Graphical Interface. Starting Update UTMP about System Runlevel Changes... [ OK ] Finished Update UTMP about System Runlevel Changes. [ 426.099108] cloud-init[851]: Cloud-init v. 20.4.1-0ubuntu1~20.04.1 running 'modules:config' at Wed, 01 Apr 2020 17:30:45 +0000. Up 426.06 seconds. [ OK ] Finished Apply the settings specified in cloud-config. Starting Execute cloud user/final scripts... [ 426.274329] cloud-init[856]: Cloud-init v. 20.4.1-0ubuntu1~20.04.1 running 'modules:final' at Wed, 01 Apr 2020 17:30:45 +0000. Up 426.23 seconds. [ 426.274554] cloud-init[856]: Cloud-init v. 20.4.1-0ubuntu1~20.04.1 finished at Wed, 01 Apr 2020 17:30:45 +0000. Datasource DataSourceNone. Up 426.27 seconds [ 426.274693] cloud-init[856]: 2020-04-01 17:30:45,699 - cc_final_message.py[WARNING]: Used fallback datasource [ OK ] Finished Execute cloud user/final scripts. [ OK ] Reached target Cloud-init target.

Ubuntu 20.04.2 LTS ubuntu hvc0

On Mon, Mar 1, 2021 at 12:03 PM Yifan Gu notifications@github.com wrote:

I have successfully run a ubuntu vm by vmctl before upgrade MacOS 11.2.2. After upgrading my MBA to Big Sur 11.2.2, the existing VM can not start with the same status you mentioned.

Is there any error? What does vmctl attach ubuntu show?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gyf304/vmcli/issues/9#issuecomment-787602605, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI52KJ3PXCCOOLUGILRLHR3TBL7YFANCNFSM4WQVFOUA .

-- Changhee Oh 오창희 changheeoh@gmail.com

MartinPrescriba commented 3 years ago

I'm not sure if this is the same issue I just ran into, but when I have the built-in firewall turned on I am unable to get a working network connection inside the VM - which took me longer than I would like to admit to find out.

I'm on wi-fi + nat.

Is there any way we can avoid having to turn off the macOS built-in firewall each time we start/reboot the vm?

I have tried adding vmcli to the allow list but it doesn't help.

Screenshot 2021-03-03 at 11 50 07

ChangheeOh commented 3 years ago

@MartinPrescriba , Thanks for your comment. I have successfully run and ssh into my VM with the firewall turned off. After a VM successfully started, I even can ssh into the VM my firewall turned on.

@gyf304 , Please check this issue and follow up.

gyf304 commented 3 years ago

Unfortunately, I can't yet reproduce this issue. I'll keep following this issue though.

ChangheeOh commented 3 years ago

Ok, thank you.

2021년 3월 4일 (목) 오전 1:24, Yifan Gu notifications@github.com님이 작성:

Unfortunately, I can't yet reproduce this issue. I'll keep following this issue though.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gyf304/vmcli/issues/9#issuecomment-789840430, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI52KJZQXJZ2KBGHIWEJVRDTBZPCPANCNFSM4WQVFOUA .

-- Changhee Oh 오창희 changheeoh@gmail.com

paul-hammant commented 3 years ago

My firewall is off, but I still get:

$ vmctl ssh ubuntu
cat: /Users/paul/VMs/ubuntu/0.ipaddr: No such file or directory
gyf304 commented 3 years ago

My firewall is off, but I still get:

$ vmctl ssh ubuntu
cat: /Users/paul/VMs/ubuntu/0.ipaddr: No such file or directory

This usually means the network adapter is not working on the client. Are there errors during bootup? (you can check using vmctl attach ubuntu)

Additionally, Virtual Machine cannot be started with networking when InternetSharing is already enabled, see #5 .

paul-hammant commented 3 years ago

InternetSharing is off. If I do vmctl attach ubuntu I'm not quick enough to see the network stuff in the log:

[  OK  ] Started Getty on tty1.
[  OK  ] Reached target Login Prompts.
[  OK  ] Finished GRUB failed boot detection.
[  OK  ] Started Authorization Manager.
[  OK  ] Started Accounts Service.
[  OK  ] Started Login Service.
[  OK  ] Started Unattended Upgrades Shutdown.
[  OK  ] Started LSB: automatic crash report generation.
[  OK  ] Finished Pollinate to seed…seudo random number generator.
         Starting OpenBSD Secure Shell server...
[  OK  ] Started Dispatcher daemon for systemd-networkd.
[FAILED] Failed to start OpenBSD Secure Shell server.
See 'systemctl status ssh.service' for details.
[  OK  ] Stopped OpenBSD Secure Shell server.
         Starting OpenBSD Secure Shell server...
[FAILED] Failed to start OpenBSD Secure Shell server.
See 'systemctl status ssh.service' for details.
[  OK  ] Stopped OpenBSD Secure Shell server.
         Starting OpenBSD Secure Shell server...
[FAILED] Failed to start OpenBSD Secure Shell server.
See 'systemctl status ssh.service' for details.
[  OK  ] Stopped OpenBSD Secure Shell server.
         Starting OpenBSD Secure Shell server...
[FAILED] Failed to start OpenBSD Secure Shell server.
See 'systemctl status ssh.service' for details.
[  OK  ] Stopped OpenBSD Secure Shell server.
         Starting OpenBSD Secure Shell server...
[FAILED] Failed to start OpenBSD Secure Shell server.
See 'systemctl status ssh.service' for details.
[  OK  ] Started Snap Daemon.
         Starting Wait until snapd is fully seeded...
[  OK  ] Stopped OpenBSD Secure Shell server.
[FAILED] Failed to start OpenBSD Secure Shell server.
See 'systemctl status ssh.service' for details.
[  OK  ] Finished Wait until snapd is fully seeded.
[  OK  ] Finished Service for snap application lxd.activate.
[  OK  ] Reached target Multi-User System.
[  OK  ] Reached target Graphical Interface.
         Starting Update UTMP about System Runlevel Changes...
[  OK  ] Finished Update UTMP about System Runlevel Changes.
gyf304 commented 3 years ago

You can scroll back the screen per instructions here: https://unix.stackexchange.com/questions/40242/scroll-inside-screen-or-pause-output

It will be also useful to check logs in the MacOS console: https://support.apple.com/guide/console/find-log-messages-and-activities-cnslbf30b61a/mac

ruyrybeyro commented 2 years ago

See my issue #24, I am in 12.0.1 ; I also did not have 0.ipaddr because my interface was not configured, not up. Had to login via vmctl attach and create a netplan configuration file. Your logs seems identical to my situation.

jriddy commented 6 months ago

I ran into this issue, and it does appear to be firewall settings interfering with the interface in the VM come up, likely the bootpd service being blocked. https://github.com/canonical/multipass/issues/2387 has a remedy that worked for me

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