Virtualbox Lubuntu boots to a black screen- please help

Discussions about using Linux guests in VirtualBox.
adi5
Posts: 1
Joined: 14. Sep 2020, 14:21

Virtualbox Lubuntu boots to a black screen- please help

Post by adi5 »

I was using my Lubuntu 20.04 virtualbox guest OS just this morning and it was running fine. Host is Ubuntu 16.04. I attempted to install an update, I remember it said there was some error with installing it but I can't recall exactly what it said.

I then rebooted the OS, it opens to the password screen for LUKS, then I can see the Lubuntu logo loading for a few seconds, then it goes to a black screen and all I can see is the cursor on the screen. I tried rebooting the OS 20 times, rebooting my laptop, increasing the video memory of the guest, and even exported the OVA, importing again, but nothing seems to work.

What might the problem be and how can I go about fixing it?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Virtualbox Lubuntu boots to a black screen- please help

Post by scottgus1 »

Start the guest from full power off, not save-state. Run until you see the problem happen, then shut down the guest from within the guest OS if possible. If not possible, close the Virtualbox window for the guest with the Power Off option set.

Please right-click the guest in the main Virtualbox window's guest list, choose Show Log. Save the far left tab's log, zip the log file, and post the zip file, using the forum's Upload Attachment tab.
CornelisJ
Posts: 12
Joined: 5. Dec 2015, 20:55

Re: Virtualbox Lubuntu boots to a black screen- please help

Post by CornelisJ »

I have the same problem as the topic starter.
HOST OS: Windows 7 Ultimate 64-bit
Guest OS: Lubuntu 16.04.7 LTS 32-bit

After updating Virtualbox from 6.0.24 to 6.1.14, the first boot of Lubuntu (with Guest Additions 6.0.24 still installed) went OK.
The problem started after installing Guest Additions 6.1.14 on Lubuntu. When I rebooted after installation of GA 6.1.14, I got a small login screen (800x600), while before the login screen had the full screen size. After login the screen size stayed small and turned black (also no cursor), and the VM hanged (also no disk activity). I then first tried to close the Guest VM by sending the shutdown signal, but that did not work. Then I closed the guest VM by means of Power Off. The Log file and VM definition are included in attached zip file.
It seems that the problem is caused by Guest Additions 6.1.14 for Linux, since the problem happens only after installation of GA 6.1.14 on the Lubuntu Guest.
Vbox_6.1.14_Lubuntu_log.zip
(39.08 KiB) Downloaded 36 times
Additional information:
When starting the powered off Lubuntu guest again, I again got the black screen after login on the Guest.
But this time I found that I could start the Lubuntu Guest by means of the following "workaround":
- After the guest screen turned black after login, I typed: CTRL+ALT+F1
- I then got a commandline login screen. After entering username and password, I typed:
$ sudo service lightdm stop
$ sudo service lightdm start

Then I got the normal Full screen graphical login screen. After login the Lubuntu guest worked normal.
So it seems that GA 6.1.14 for Linux is causing a startup problem of Lubuntu's LightDM display manager.

PS: A few months ago I also tried to update to Virtualbox 6.1.x, but back then I had the exact same problem. So earlier versions of the 6.1.x Guest Addition also were causing a Lubuntu 16.04.x startup problem. That is the reason that I continued to use the Virtualbox 6.0 branch.
Last edited by CornelisJ on 16. Sep 2020, 22:03, edited 1 time in total.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Virtualbox Lubuntu boots to a black screen- please help

Post by scottgus1 »

Try increasing video RAM to maximum.
CornelisJ
Posts: 12
Joined: 5. Dec 2015, 20:55

Re: Virtualbox Lubuntu boots to a black screen- please help

Post by CornelisJ »

scottgus1 wrote:Try increasing video RAM to maximum.
I have just tried that. I increased the Video RAM size from 16MB to 128MB, but the startup problem stays the same.
Btw, do the 6.1.x GA require more video RAM than the 6.0.x GA? When I create a new VM for 32-bit Ubuntu, Virtualbox 6.1.14 sets the video RAM size to 16MB by default.

The fact that the Lubuntu guest works fine with 16MB of video RAM after applying the workaround that I have mentioned in my post (CTRL+ALT+F1, login on commandline, sudo service lightdm stop, sudo service lightdm start) is for me an indication that the problem is not caused by lack of Video RAM.

There are several posts on this forum that describe a black screen at startup of Linux guests after installation of Virtualbox 6.1.x Guest Additions, and most of them are without resolution. To mention a few:
Guest Additions 6.1.10 Black Screen with LinuxMint 18
Black screen in Mint guest after login
To me this seems an indication that there is a problem in the GA 6.1.x for Linux guests.

Anyway I will revert to Virtualbox 6.0.24 (luckily I made a backup of my VM before trying 6.1.14), since that Vbox/GA version works OK for me.
alealeale
Posts: 3
Joined: 12. Sep 2019, 13:27

Re: Virtualbox Lubuntu boots to a black screen- please help

Post by alealeale »

Are you using VMSGA as Graphical Controller?
When you are on the black screen after login, could you try pressing CTRL+ALT+F1 (it seems that xorg is not running on the first tty in your case) and then CTRL+ATL+Fn (with n the tty number where xorg is running).
Just switch to a different tty and then back to the tty where xorg is running, without restarting lightdm.
I've a similar problem and I'd like to know if you are facing the same I described in ticket #19873.
CornelisJ
Posts: 12
Joined: 5. Dec 2015, 20:55

Re: Virtualbox Lubuntu boots to a black screen- please help

Post by CornelisJ »

alealeale wrote:Are you using VMSGA as Graphical Controller?
At this moment I can only say that the graphics controller for the Lubuntu Guest is indeed VMSVGA. Your other question I can't answer at this moment, since I am now on VirtualBox 6.0.24 with 6.0.24 Guest Additions, and this setup does not have the black screen problem.
CornelisJ
Posts: 12
Joined: 5. Dec 2015, 20:55

Re: Virtualbox Lubuntu boots to a black screen- please help

Post by CornelisJ »

CornelisJ wrote:I have the same problem as the topic starter.
HOST OS: Windows 7 Ultimate 64-bit
Guest OS: Lubuntu 16.04.7 LTS 32-bit

After updating Virtualbox from 6.0.24 to 6.1.14, the first boot of Lubuntu (with Guest Additions 6.0.24 still installed) went OK.
The problem started after installing Guest Additions 6.1.14 on Lubuntu. When I rebooted after installation of GA 6.1.14, I got a small login screen (800x600), while before the login screen had the full screen size. After login the screen size stayed small and turned black (also no cursor), and the VM hanged (also no disk activity).
Just want to report that my black screen + Linux guest hanging problem is solved after installation of Virtualbox 6.1.16 + Guest Additions 6.1.16.
After installing Guest Editions 6.1.16 on my Lubuntu 16.04.7 32-bit guest, I still get a small login screen. But after login the guest starts up normally and gets full screen size.
=> Problem is solved for me.

I think that the following fix (from VBox 6.1.16 release notes) has solved the problem:
  • Linux guest: Workaround to improve resizing of 32-bit VMs with VMSVGA graphics controller, and do not try to use RandR version 1.3 due to bugs causing the X server to hang.
arQon
Posts: 228
Joined: 1. Jan 2017, 09:16
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Ubuntu 16.04 x64, W7

Re: Virtualbox Lubuntu boots to a black screen- please help

Post by arQon »

alealeale wrote:Are you using VMSGA as Graphical Controller?
When you are on the black screen after login, could you try pressing CTRL+ALT+F1 (it seems that xorg is not running on the first tty in your case) and then CTRL+ATL+Fn (with n the tty number where xorg is running).
Just switch to a different tty and then back to the tty where xorg is running, without restarting lightdm.
I've a similar problem and I'd like to know if you are facing the same I described in ticket #19873.
note that this is the wrong key sequence: it needs to be HOSTKEY+Fn.
alealeale
Posts: 3
Joined: 12. Sep 2019, 13:27

Re: Virtualbox Lubuntu boots to a black screen- please help

Post by alealeale »

CornelisJ wrote:Just want to report that my black screen + Linux guest hanging problem is solved after installation of Virtualbox 6.1.16 + Guest Additions 6.1.16.
After installing Guest Editions 6.1.16 on my Lubuntu 16.04.7 32-bit guest, I still get a small login screen. But after login the guest starts up normally and gets full screen size.
=> Problem is solved for me.

I think that the following fix (from VBox 6.1.16 release notes) has solved the problem:
  • Linux guest: Workaround to improve resizing of 32-bit VMs with VMSVGA graphics controller, and do not try to use RandR version 1.3 due to bugs causing the X server to hang.
For me 6.1.16 doesn't fix the problem.
I still have to go back to 6.1.6 additions to find a version without that problem.
BTW I'm using a 64 bit-VM, should I have to hope for the same fix for 64-bit VMs?
alealeale
Posts: 3
Joined: 12. Sep 2019, 13:27

Re: Virtualbox Lubuntu boots to a black screen- please help

Post by alealeale »

arQon wrote:
alealeale wrote:Are you using VMSGA as Graphical Controller?
When you are on the black screen after login, could you try pressing CTRL+ALT+F1 (it seems that xorg is not running on the first tty in your case) and then CTRL+ATL+Fn (with n the tty number where xorg is running).
Just switch to a different tty and then back to the tty where xorg is running, without restarting lightdm.
I've a similar problem and I'd like to know if you are facing the same I described in ticket #19873.
note that this is the wrong key sequence: it needs to be HOSTKEY+Fn.
That's not the wrong key sequence.
To switch between VT, the combination is ALT+Fn, +CTRL if you are on X session.
On VirtualBox, If you right CTRL is set as HOSTKEY then CTRL is the left CTRL.
You can use HOSTKEY+Fn as you suggested, maybe it's even more comfortable, anyway CTRL+ATL+Fn is not wrong at all.
Having to deal also with real machines and not VMs only, I'm used to press left CTRL+ATL+Fn, so that's automatic and absolutely natural to me.
arQon
Posts: 228
Joined: 1. Jan 2017, 09:16
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Ubuntu 16.04 x64, W7

Re: Virtualbox Lubuntu boots to a black screen- please help

Post by arQon »

alealeale wrote:Having to deal also with real machines and not VMs only, I'm used to press left CTRL+ATL+Fn, so that's automatic and absolutely natural to me.
I know the feeling: but it doesn't change the fact that it's still not quite correct - rather obviously so if you consider non-Linux hosts. :)

The root of the problem is the guest failing to repaint. You may be able to trigger that in your case by changing the HOST to a different VT and back again, but only by chance if so. (It will PROBABLY also work if the guest has the keyboard captured). But the combination needed to change the GUEST VT, reliably, regardless of host platform, is HOSTKEY+Fn.

I think you're confusing something that happens to work for your setup with the "real" workaround of forcing the guest to resize/redraw. That your approach happens to be convenient for you is a fortunate bonus, but it's nonetheless not actually the right answer, and doesn't work for the general case.

(Doesn't mean YOU need to change what you're doing, but insisting that it's correct when there are multiple cases where it isn't just makes things confusing for others).
arQon
Posts: 228
Joined: 1. Jan 2017, 09:16
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Ubuntu 16.04 x64, W7

Re: Virtualbox Lubuntu boots to a black screen- please help

Post by arQon »

The good news is, I realised that if my understanding of the bug was correct (which it apparently is), I could hack up a fix. :)

Code: Select all

$ cat ~/vbox-displayinit-bug.sh 
#!/bin/bash
logger 'Resizing display to work around VMSVGA driver bugs...'
xrandr --size 1920x1440
xrandr --size 1920x1200
I would suggest running that through whatever mechanism your DE offers for such things rather than xsessionrc, but either approach should work fine. (Don't forget to +x it. The message is there so you can check that it did actually run).

Obviously you need to tailor it to your monitor, but note the specifics: while you MIGHT get away with resizing it SMALLER than the display and then back, it's definitely better to go with larger in case your DE throws a tantrum and moves/resizes some app windows to compensate (session restore or autostarted apps).

@alealeale - although you're starting your VM on a different display, you DON'T want to mess with --output etc in yours. Remember that it's the GUEST display that's buggy, not the HOST one. HTH.
crafty
Posts: 2
Joined: 28. Oct 2020, 00:28

Re: Virtualbox Lubuntu boots to a black screen- please help

Post by crafty »

I'm having a similar problem (Ubuntu 20.04 guest boots to black screen). It's easy enough to solve by using Host+F to toggle full-screen mode off and back on again.

Looking at the VirtualBox log I note the following:

Code: Select all

00:00:51.786712 GUI: UIMachineLogicFullscreen: Guest-screen count changed
00:00:51.786760 GUI: UIMultiScreenLayout::update: GUI/AutomountGuestScreens is disabled
00:00:51.786806 GUI: UIMachineLogic: Guest-screen count changed
00:00:51.786819 GUI: UIMachineViewFullscreen::adjustGuestScreenSize: Adjust guest-screen size if necessary.
00:00:51.792671 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=0000000000000000 w=2560 h=1440 bpp=0 cbLine=0x0 flags=0x2 origin=0,0
I'm no expert, but the "bpp=0" seems wrong to me. When I toggle out of full-screen mode and back again the log shows:

Code: Select all

00:01:15.113639 GUI: UIMachineViewNormal::resendSizeHint: Restoring guest size-hint for screen 0 to 2560x1335
00:01:15.415589 GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen 0 as 2560x1335 if necessary
00:01:15.417030 VMMDev: SetVideoModeHint: Got a video mode hint (2560x1335x0)@(0x0),(1;0) at 0
00:01:15.450078 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=000000001027a000 w=2560 h=1335 bpp=32 cbLine=0x2800 flags=0x1 origin=0,0
00:01:15.451668 GUI: UIMachineLogic: Guest-screen count changed
00:01:23.047150 GUI: UIMultiScreenLayout::update: GUI/AutomountGuestScreens is disabled
00:01:23.065357 GUI: UIMachineViewFullscreen::adjustGuestScreenSize: Adjust guest-screen size if necessary.
00:01:23.065371 GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen 0 as 2560x1440 if necessary
00:01:23.065387 VMMDev: SetVideoModeHint: Got a video mode hint (2560x1440x32)@(0x0),(1;0) at 0
00:01:23.066369 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=0000000000000000 w=2560 h=1335 bpp=0 cbLine=0x0 flags=0x2 origin=0,0
00:01:23.082431 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=000000001027a000 w=2560 h=1440 bpp=32 cbLine=0x2800 flags=0x1 origin=0,0
Note that bpp now has its correct value of 32.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Virtualbox Lubuntu boots to a black screen- please help

Post by fth0 »

If you filter all log messages containing Display::i_handleDisplayResize, you'll recognize the pattern. Resolution changes are usually indicated by turning off the screen with the current resolution (bpp=0), and turning it on with the new resolution (bpp=32).

As an experiment, note the wall clock times when you're starting the VM and at each resolution change (including full-screen changes). If you use different time intervals for each step, they are even easier to recognize in the VBox.log file afterwards.
Post Reply