Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Ubuntu Compute Engine VM unaccessible after `sudo reboot`

Hi everyone,

I've been trying this about 15 times and failing every time.
This is what I do:

  1. I create an Ubuntu 24.04 VM
  2. I ssh into it, via cli (gcloud compute ssh VM_NAME) or console SSH button
  3. I install tailscale and ubuntu-desktop for some internal marketing use
  4. I reboot with `sudo reboot`
  5. Instance's ssh doesn't start, tailscale is down, I can't access the instance in any way and I have to delete it

These are some of the errors I get:

2025-02-20T10:26:26.598949+00:00 marketing-instance-ubuntu24 google_guest_agent[944]: ERROR metadata.go:68 Error watching metadata: c Stopping serial-getty@ttyS0.service - Serial Getty on ttyS0...

2025-02-20T10:26:47.640649+00:00 marketing-instance-ubuntu24 tailscaled[645]: health(warnable=warming-up): error: Tailscale is starting. Please wait.

2025-02-20T10:26:50.835466+00:00 marketing-instance-ubuntu24 google_guest_agent[950]: Failed to rollback primary nic (left over) config for NetworkManager: error reloading NetworkManager config cache: exec: "nmcli": executable file not found in $PATH

2025-02-20T10:26:50.835810+00:00 marketing-instance-ubuntu24 google_guest_agent[950]: Unable to roll back config for NetworkManager: error reloading NetworkManager config cache: exec: "nmcli": executable file not found in $PATH

2025-02-20T10:26:56.896422+00:00 marketing-instance-ubuntu24 google_guest_agent[950]: ERROR oslogin.go:173 Error reloading service: Failed to reload-or-restart sshd.service: Unit sshd.service not found..

025-02-20T10:30:00.192906+00:00 marketing-instance-ubuntu24 chrome-remote-desktop[3535]: [0220/103000.192745:ERROR:stream_packet_socket.cc(427)] Stream socket received net error: -109

2025-02-20T10:30:00.193000+00:00 marketing-instance-ubuntu24 chrome-remote-desktop[3535]: [0220/103000.192777:ERROR:turn_port.cc(437)] Port[14ee00:0:1:0:relay:Net[tailscale0:fd7a:115c:a1e0:x:x:x:x:x/128:Unknown:id=5]]: Failed to create TURN client socket

2025-02-20T10:30:01.173275+00:00 marketing-instance-ubuntu24 chrome-remote-desktop[3535]: [0220/103001.173217‌⚠️‌p2p_transport_channel.cc(1339)] Failed to resolve ICE candidate hostname 560031f1-d3c6-4a3c-9991-443bc2456380.local with error -3

What am I doing wrong?
My ssh keys are registered in the project's metadata, why every instance I create and reboot fails to start ssh?
Also I run troubleshoot and find zero errors:

---- Checking user permissions ----
User permissions: 0 issue(s) found.

---- Checking VPC settings ----
VPC settings: 0 issue(s) found.

---- Checking VM status ----
The Monitoring API is needed to check the VM's Status.

If not already enabled, is it OK to enable it and check the VM's Status? (Y/n)?  

VM status: 0 issue(s) found.
---- Checking VM boot status ----
VM boot: 0 issue(s) found.


Thanks in advance,
Mike S

Solved Solved
1 1 278
1 ACCEPTED SOLUTION

Hi @Msarchioto

Welcome to Google Cloud Community! 

The broken NetworkManager might be preventing the VM from establishing the necessary network connection to reach the metadata server. This will cause the ssh and the instance to fail. Here are the troubleshooting steps focusing on NetworkManager and Metadata

For reference, check the Installation of NetworkManager.

1. Verify NetworkManager Installation

  • Boot into the instance (if you can even briefly get in before it becomes inaccessible).

  • Run:

    sudo apt update
  • Run:

    sudo apt install network-manager

    (Force reinstall NetworkManager to ensure all dependencies are met).

  • Run:

    sudo apt install network-manager-gnome
  • Run:

    sudo apt install nmcli
  • Run:

    which nmcli 

    confirm that nmcli is in /usr/bin/nmcli

2. Configure NetworkManager

  • Configure NetworkManager to manage your network interface. This often involves modifying /etc/netplan files to disable netplan and let NetworkManager take over.

  • Example: Edit /etc/netplan/01-network-manager-all.yaml (create it if it doesn't exist) and add the following:

    network:
      version: 2
      renderer: NetworkManager
  • Then run:

    sudo netplan apply

3. Disable systemd-networkd (if it's running)

  • sudo systemctl disable systemd-networkd
  • sudo systemctl stop systemd-networkd

4. Enable NetworkManager

  • sudo systemctl enable NetworkManager
  • sudo systemctl start NetworkManager
  • sudo systemctl status NetworkManager

    Verify it's running correctly

5. Fix sshd Service Not Found

  • Run:

    sudo apt install openssh-server

    this should install/configure the sshd systemd unit file

  • Run:

    sudo systemctl enable sshd
  • Run:

    sudo systemctl start sshd
  • Run:

    sudo systemctl status sshd

    Verify it's running correctly

6. Check Google Guest Agent

  • sudo systemctl status google-guest-agent

    Make sure it's running

  • If it's not running, try:

    sudo systemctl enable google-guest-agent

    and 

    sudo systemctl start google-guest-agent

7. Verify Metadata Server Access (after fixing NetworkManager)

  • Inside the VM, run: 

    curl "http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip" -H "Metadata-Flavor: Google"

    This should return the external IP address of your VM. If it fails, it confirms the metadata server connectivity issue.

8. Reboot and Monitor

  • sudo reboot

    After successfully rebooting Install Tailscale and Ubuntu Desktop.


If the issue still persists and needs further assistance with specific configurations, please feel free to reach out to our Google Cloud Support team.


Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.

View solution in original post

1 REPLY 1

Hi @Msarchioto

Welcome to Google Cloud Community! 

The broken NetworkManager might be preventing the VM from establishing the necessary network connection to reach the metadata server. This will cause the ssh and the instance to fail. Here are the troubleshooting steps focusing on NetworkManager and Metadata

For reference, check the Installation of NetworkManager.

1. Verify NetworkManager Installation

  • Boot into the instance (if you can even briefly get in before it becomes inaccessible).

  • Run:

    sudo apt update
  • Run:

    sudo apt install network-manager

    (Force reinstall NetworkManager to ensure all dependencies are met).

  • Run:

    sudo apt install network-manager-gnome
  • Run:

    sudo apt install nmcli
  • Run:

    which nmcli 

    confirm that nmcli is in /usr/bin/nmcli

2. Configure NetworkManager

  • Configure NetworkManager to manage your network interface. This often involves modifying /etc/netplan files to disable netplan and let NetworkManager take over.

  • Example: Edit /etc/netplan/01-network-manager-all.yaml (create it if it doesn't exist) and add the following:

    network:
      version: 2
      renderer: NetworkManager
  • Then run:

    sudo netplan apply

3. Disable systemd-networkd (if it's running)

  • sudo systemctl disable systemd-networkd
  • sudo systemctl stop systemd-networkd

4. Enable NetworkManager

  • sudo systemctl enable NetworkManager
  • sudo systemctl start NetworkManager
  • sudo systemctl status NetworkManager

    Verify it's running correctly

5. Fix sshd Service Not Found

  • Run:

    sudo apt install openssh-server

    this should install/configure the sshd systemd unit file

  • Run:

    sudo systemctl enable sshd
  • Run:

    sudo systemctl start sshd
  • Run:

    sudo systemctl status sshd

    Verify it's running correctly

6. Check Google Guest Agent

  • sudo systemctl status google-guest-agent

    Make sure it's running

  • If it's not running, try:

    sudo systemctl enable google-guest-agent

    and 

    sudo systemctl start google-guest-agent

7. Verify Metadata Server Access (after fixing NetworkManager)

  • Inside the VM, run: 

    curl "http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip" -H "Metadata-Flavor: Google"

    This should return the external IP address of your VM. If it fails, it confirms the metadata server connectivity issue.

8. Reboot and Monitor

  • sudo reboot

    After successfully rebooting Install Tailscale and Ubuntu Desktop.


If the issue still persists and needs further assistance with specific configurations, please feel free to reach out to our Google Cloud Support team.


Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.