Locked out of Ubuntu vm after power outtage? reddit / selfhosted ---------------------------------------------------------------------- notdoreen · 2023-12-15 21:28 EDIT: Thank you u/_Answer_42. I entered command 'netplan apply' and it flagged an indentation error in my config file. I went ahead and fixed it and everything is working properly. No idea how a power outage modified my config file tho. I thought I had assigned a static IP to the VM so I hadn't. I went ahead and did that so this doesn't happen again. I lost power for about 8 hours last night. After turning my server back on, I noticed I couldn't access any of my cocker containers (on my ubuntu server vm). I checked the procmoc console and noticed that instead of the usual "welcome to ubuntu server, access via we on `MY IP ADDRESS` instead it says to access via the name of my server: `https:my-server:9090` which I know is the cockpit socket. `https:my-server:9090` doesn't work and neigher does `MY IP ADDRESS:9090` Trying to ssh into `MY IP ADDRESS` doesn't work either. I removed cockpit to see if it would revert back to showing me the ip address but it doesn't. I see the welcome screen but no mention of the vm's ip. I tried `ip a` and `ip addr`and I get 17 lines of output a bunch of random addresses starting with 172 named global br-... I don't know what these are and I can only see the output from lines 9 through 17 because they don't all fit in one screen but this is the proxmox shitty console and I'm not able to scroll up or down. I stopped all my docker containers to nesure the output isn't clogged. I redirected the output to a a file: so I could open it with nano and checked the content but it's still a bunch of those 172 addresses. line one has my [127.0.0.1](https://127.0.0.1) local address but everything else is 172. No 192 address anywhere which should be my vm's address. Finally I checked the vm's netplan config.yaml file and everything looks the way I set it up using Google and Cloudflare DNS: https://preview.redd.it/x639as4j0j6c1.png?width=572&format=png&auto=we bp&s=852e7ffeb30c6d08e8c6cbc81b1c4128d5bf1f25 I reset the network using `systemctl restart systemd-networkd` but that didn't fix it either. Is there anything else I should be checking for or trying? I'm out of answers at this point. The vm is clearly up and running but it seems to have lost it's own ip address. ---------------------------------------------------------------------- _Answer_42 · 2023-12-15 22:15 Is your gateway IP is [192.168.0.1](https://192.168.0.1) ? ---------------------------------------------------------------------- ddmlink · 2023-12-15 22:48 If this happened after a power outage, my first guess would be that another device claimed your VM's IP first. If you ping what the IP address is supposed to be, do you get any replies? I use DHCP reservations in my router instead of static addresses to prevent situations like this. ---------------------------------------------------------------------- notdoreen · 2023-12-15 23:06 The reply is that it's unavailable ---------------------------------------------------------------------- Other-Technician-718 · 2023-12-16 00:37 There is no point in hiding RFC1918 IP ranges as they are not routable over the interwebs. It only makes reading harder for us and leads to repeating questions e.g. if the IP of your server is in the right subnet for your gateway. Do you have to start something else up like a switch? Can you ping / traceroute all devices? Can you connect to your server when you connect a client directly without any other device inbetween? Have you tried a clean shutdown and rebooting again in the right order? Do you have a backup? ---------------------------------------------------------------------- ddmlink · 2023-12-16 01:02 Re-reading this, it is pretty strange that it went from a 192 address to a 172 address. Did any other devices do the same? I think this is the direction that _Answer_42 was going. I would give Other-Technician-718's steps a try and make sure everything comes up in the correct order. ---------------------------------------------------------------------- notdoreen · 2023-12-16 01:04 Yes ---------------------------------------------------------------------- ddmlink · 2023-12-16 01:43 Adding on to this, it's Ubuntu running in a VM, right? If so, it could be a network adapter setting. ---------------------------------------------------------------------- _Answer_42 · 2023-12-16 01:52 Use `ip addr show ens18` to get the address for specific interface ---------------------------------------------------------------------- notdoreen · 2023-12-16 04:18 Thank you for this! I tried netplan apply and found an indentation error in my config file. Really weird because I have not touched this file since forever. I went in and fixed it and all is working well again. I had no clue this was a thing that could happen but thank you for your comment. I went into my router and assigned the ip address to the MAC address of the vm so this doesn't happen again. Thanks again.