3

I'm only a casual Ubuntu user and I'm new to managing my own virtual machine, so I'm hoping I'm missing something obvious. I use Hyper-V on Windows 10 to run an Ubuntu 20.04 VM, which I only need in order to run some models for work. Everything has worked fine over several months of regular use.

Today on the VM I had to kill a model process that had been set up wrong and was running too long and filling the virtual hard drive. Maybe importantly, while this process was still running, I had canceled a 'system program problem detected' popup (then promptly forgot about it, of course).

After killing the problematic process, the session seemed fine. I used top to make sure the right process had been killed. Then I meant to shut down the VM from the terminal, but I accidentally rebooted it instead - wrong muscle memory, probably not important.

However, since the VM restarted, I haven't been able to connect to it. From the Hyper-V manager, I can shut down and start the VM (successfully, according to Hyper-V), and when I try to connect, I get the xrdp login screen. But after entering my username and password, the connection hangs on the blue screen, then eventually pops up this error:

connecting to sesman ip 127.0.0.1 port 3350
sesman connect ok
sending login info to session manager, please wait...
login successful for display 10
started connecting
connection problem, giving up
some problem

I see that others have had similar blue-screen problems (e.g. Error/problem connecting (Windows 10 RDP into XRDP)) and solutions generally suggest issues with xrdp. Or the problem may relate to the 'system program problem detected' error, which unfortunately I didn't look closely at when I had the chance.

However, herein lies my problem: even exploring these issues(s) presumably requires access to a terminal on the Ubuntu VM - but I can't connect to the Ubuntu VM - so it seems like I can't get access to a terminal to even try to fix things.

So - can anyone give me pointers on using Moba or some other approach to access a terminal on the VM? Or is the VM just toast? Thoughts on what might have gone wrong to begin with? Any suggestions appreciated.

(For the record, the main reason I care is some scripts and other files saved on the virtual hard drive that I'd hate to have to recreate. So if there is a way to just access the files on the VHDX, that would be an acceptable workaround.)



Other things I've tried, in case they shed more light:

  • Restarting the Windows 10 host machine, because I'd feel especially dumb if this fixed it and I hadn't tried. No effect.
  • Disabling enhanced session mode in the Hyper-V settings: in this case, after 'Connecting' and starting the VM, the Hyper-V/Ubuntu splash screen appears, then a lot of text runs by too fast to see (startup info, I assume), and then there's an eternal blinking cursor on a black screen.
  • Copying the VHDX using the 'convert' option in the Hyper-V 'Edit disk' utility, then expanding the size of this copy and attaching it to the VM (in case the problem was the full disk from the killed process). This had no effect - same hang on the blue screen as the original problem.
  • Accessing the running VM using its ip address via mobaxterm. The connection was refused, although my understanding of ssh, ports, etc. is minimal and I may have set it up wrong.
  • Hoping to just get access to the VHD files, I built a new Hyper-V VM attached to the copy of the VHDX I created above. However, this new VM fails to find a boot image and can't load the OS - I didn't pursue this further because it's above my pay grade and seemed like a long shot anyway.

Thanks again for any insight.

3 Answers3

11

i run into this issue as well but on 22.04 LTS, i see nobody answered the question for two years, i was able to fix the issue- from the Hyper-V VM connector menu go to View and if the Enchanced session option is ticked - disable it.

see also screenshot

Daniel T
  • 4,594
3

Same exact symptoms on my system, and disabling enhanced view did not fix it for me.

I was able to fix it by freeing up disk space on the guest Ubuntu 20.04 VM. I did this as follows:

  • Start VM and disable enhanced session (for me this lead to a frozen black screen, no response)
  • In host Windows 10, run 'arp -a' in cmd. Ip of the running VM can be found here. Might need a bit of trial end error to find the correct one (there are probably better ways to find the ip of the running VM).
  • Using WinSCP, connect to the running VM. Here I was able to get the files I did not want to lose back to the host Windows 10 and back them up. (note there are a lot of tools other than WinSCP available to do the same thing)
  • Using WinSCP, remove large files on the running VM to free up virtual disk space.
  • Reconnect to the VM, enabling enhanced session, in my case regaining access.

Lesson learned for me: always make sure you are not running critical on virtual disk space in a VM. (And always backup files you do not want to lose, your system might fail at any time.)

First time posting on this forum, any feedback on how this response is structured is welcome.

0

See this answer. Remote Desktop from Windows onto Ubuntu 22.04 takes me to a XRDP login then a blank screen

I am able to use enhanced mode after following Sridhar Sarnobat answer. The catch is disable enhanced session to get in, run the commands below then REBOOT. You can then enable Enhanced session and logon.

In ~/.xsession-errors:

# Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Failed to execute child process “dbus-launch” (No such file or directory)
dbus-update-activation-environment: error: unable to connect to D-Bus: /usr/bin/dbus-launch terminated abnormally without any error message
dbus-update-activation-environment: error: unable to connect to D-Bus: /usr/bin/dbus-launch terminated abnormally without any error message

Solution:

sudo apt install dbus-x11
dbus-launch

Credits: https://c-nergy.be/blog/?p=16698

More info: https://gist.github.com/milnak/54e662f88fa47a5d3a317edb712f957e

tripleee
  • 1,474
Ritz
  • 1