Score:3

Ubuntu VM on Hyper V freezes after launch

cz flag

I have an Ubuntu(22.04) VM on Hyper V(WIN 10 Pro host). The VM ideally should have 2 network adapters, one connected to internal network, and one is connected to the default switch. I never had issues when it only had one adapter(either internal or default), but once I added another adapter, it would freeze. I could CTRL+ALT+F1 to regain control for a couple of seconds only for it to freeze again. Mind you the shell (CTRL+ALT+F3) is working fine, and it shows that the system is up and running. I created another VM to check if having two network adapters was an issue, and while that VM(with two network adapters from the start) booted up fine the first time, after turning off and on again I had freezing issues again. I tried a couple of solutions I found online(remove the network adapter from the Hyper V side and restart etc) but to no avail. Note that the system boots up and works fine on recovery mode. I am lost as to what could be the solution to the issue, considering I don't usually work with VMs.

Any help is great, and let me know if you need more information.

x13 avatar
cn flag
x13
You're not the only one experiencing this exact same issue. I've found that adding `nomodeset` to grub cmdline prevents it from freezing on the login screen, it now only freezes right after logging in. I don't think network adapter is related to this at all
Lonermoan avatar
cz flag
but like if i just start off with 1 adapter, regardless of whether its an private network or connected to the internet, its all fine. it only happens if the vm gets 2 network adapters
x13 avatar
cn flag
x13
Well that is just a coincidence then. It makes no sense at all for your desktop enviroment to freeze if you have more than 1 network adapter, but if you look at the link i put in my answer below, you'll see it's more related to the kernel version. In your case ubuntu 22.04 has the problematic 5.19 kernel that causes this issue
cn flag
Apparently using `nomodeset` in the GRUB configuration works on Ubuntu Desktop 23.04 LTS as well. At least, kind of. Honestly, Linux under Hyper-V is a terrible experience all-around. Getting basic things working is a disaster.
Score:3
cn flag
x13

I ran into this issue too, and today i have found out that it's likely related to your specific kernel version. You are using 5.19 i assume? Some more specific kernel versions are mentioned here.

I tested a kernel tuned for microsoft-based virtualization (apt install linux-azure) that not only doesn't have the issue but also lets me run my VM at 1920x1080p.

Alternatively, i tried zorin OS too, and that also did not have the issue and supports 1920x1080p VM out of the box.

The linux-azure kernel and zorin OS both use 5.15 instead of 5.19 kernel, and i think this is why they do not have the freezing issue we both experienced.

Score:0
mt flag

My ubuntu vm is 22.04 lts with 5.19 kernel in win 10 pro hyper-v with external switch (the default switch not being used by this vm), and had this same(?) issue. It seems to have become stable after I changed display managers and desktop environments several times trying to find one that might work, ending up back with LightDM + Gnome after installing KDE Plasma, Cinnamon, MATE and Xfce, but I'm not sure what's actually made the difference as LightDM + Gnome wasn't stable before I tried the other desktops... I'm not changing it now lest it start freezing again. I'm very much a ubuntu novice, if it helps at all screenfetch says gnome is 41.7, llvmpipe is 15.0.7, gtk theme is Yaru (GTK2/3).

Score:0
ng flag

Solved by adding mainline, upgrading kernal & rebooting. Here are the commands:

sudo add-apt-repository ppa:cappelikan/ppa -y

sudo apt update

sudo apt install mainline

sudo mainline --install-latest

sudo reboot

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.