2

I run Ubuntu as Guest OS in a Windows VirtualBox VM Host. In the existing, up-to-date VB, I have just moved from 17.04 to 18.04 by creating a new VM/.vdi from scratch (including Guest Additions).

Previously, whatever I resized the whole VM/desktop window to was remembered across reboots, which is obviously desirable.

Under 18.04 (which, remember is now using GNOME instead of Unity, if that is relevant) this does not happen. The resizing is fine, but when I reboot it reverts to some small-ish size.

I imagine this is a Guest Ubuntu issue, not a Host VirtualBox one, so I don't think trying to ask the VB people will help any. Obviously I have installed Guest Additions, and do have View > Auto-resize Guest Display enabled.

Is this happening to other VirtualBox+18.04 users? Am I missing some setting to tell Ubuntu/GNOME to restore window/desktop size?

  • 1
    Did you tried to update Guest Addition since you upgraded your Ubuntu ? You might got a new Virtualbox version and Guest Addition may be require an upgrade as well. – ob2 Oct 31 '18 at 10:12
  • @olivierb2 Absolutely yes. In fact this was not an "in-place upgrade", it was a "fresh install" of a new .vdi [clarified this now in question]. Same VB as I previously had. Did the corresponding GA install into new VM, all went well. I believe if one has a bad GA you cannot resize the window in the first place; my resize goes well, but is not preserved across reboots. – JonBrave Oct 31 '18 at 11:11
  • the same problem in Ubuntu Mate 18.04.1 & virtualbox 5.2.22. Possible bug – ajcg Nov 23 '18 at 15:25
  • @ajcg Hmm, I'm on VB 5.2.22r126460. "Lately" (the last week??) it seems to have begun to remember/restore the whole desktop size (and also windows inside GNOME, which it tended to always full-size on re-open). So maybe it depends on which way the wind is blowing...? – JonBrave Nov 23 '18 at 15:34
  • Virtualbox v5.2.22 r126460 (Qt5.9.5) with Guest Additions in Ubuntu (Gnome and Mate Desktop) 18.04.1 x64. Does not allow to move or resize vm (and block menu in Mate). But the problem does not appear on all PCs. So far, I see that it only affects PCs that have Intel chipset and graphics (see bug bugs.launchpad.net/ubuntu/+source/linux/+bug/1728238), but I can not confirm it – ajcg Nov 23 '18 at 21:38
0

It worked for me (update Vbox 6.0):

  • Ubuntu version: 18.04.1 x64 LTS Bionic Beaver
  • Desktop: Mate Desktop Environment 1.20.1 with Marco (GPU composition with Compton)
  • Kernel version: 4.15.0-42-generic
  • VirtualBox version: v6.0.0.0 r127566 (qt5.9.5)
  • Oracle VM VirtualBox Extensions version: v6.0.0.0 r127566
  • OpenGL version string: 3.0 Mesa 18.2.2

Note: Check OpenGL with command:

glxinfo | grep "OpenGL version"

Make sure you have Mesa installed:

sudo apt-add-repository -y ppa:ubuntu-x-swat/updates && sudo apt dist-upgrade

Recomended before start:

For security reason create new folder (example: myvm) in a partition mounted (not directly in /Home or /root) or into an external disk and save only VM disk (if you have anyone without VM folder)

Important PPA:

Make sure you have the Virtualbox PPA. If you do not have it, open the terminal and execute:

~$ echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
~$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -

Bash Script

Save this script in home (example: vboxinstall.sh)

~$ chmod +x vboxinstall.sh

And run (without "sudo")

~$ ./vboxinstall.sh

Content:

#!/bin/bash
while true; do
read -p "Do you want to install Virtualbox? (y/n)" answer
case $answer in
  [Yy]* )
# execute command yes
echo "Virtualbox Pack setup..."
echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
vboxmanage list runningvms | sed -r 's/.*\{(.*)\}/\1/' | xargs -L1 -I {} VBoxManage controlvm {} savestate
sudo killall vboxwebsrv
sudo pkill virtualbox
sudo systemctl stop vboxweb-service.service
export VBOX_VER=`VBoxManage --version|awk -Fr '{print $1}'`
sudo VBoxManage extpack uninstall "Oracle VM VirtualBox Extension Pack"
sudo apt -y autoremove --purge virtualbox*
sudo rm -rf /etc/vbox /opt/VirtualBox /usr/lib/virtualbox ~/.config/VirtualBox
sudo apt update && sudo apt autoclean && sudo apt clean && sudo apt autoremove && sudo apt-get -f -y install && sudo apt-get -y dist-upgrade && sudo apt -y --fix-broken install
sudo apt -y install virtualbox-6.0 bridge-utils
sudo dpkg --configure -a && sudo apt-get -f -y install
wget -c http://download.virtualbox.org/virtualbox/$VBOX_VER/Oracle_VM_VirtualBox_Extension_Pack-$VBOX_VER.vbox-extpack
sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-$VBOX_VER.vbox-extpack
# sudo adduser $USER vboxusers
sudo usermod -a -G vboxusers $USER
echo "check groups $USER"
sudo systemctl enable vboxweb-service
sudo systemctl start vboxweb-service
sudo update-grub
sudo vboxconfig
sudo usermod -aG vboxsf ($whoami) &> /dev/null
echo "Done"
    break;;
        [Nn]* )
    # execute command no
        break;;
    * ) echo; echo "Select: YES (y) or NO (n)";;
  esac
done

Note: This script removes the previous virtualbox (and its folders), and installs it again

Create a new vm with your vm-disk (previously saved)

Do not select:

  • Extended Feactures (Enable PAE/NX)
  • Enable EFI (special OSes only)
  • Hardware Clock in UTC Time
  • Enable 3D Acceleration
  • Enable 2D Video Aceleration

Select:

  • Video memory 128 Mb
  • Shared Clipboard and Dra'nDrop Bidirectional
  • Chipset: PIIX3
  • Pointing Device: USB Tablet
  • Enable USB Controller: USB 2.0 (EHCI) Controller

Note: To select USB3.0 (xHCI) Controller you must have Intel USB 3.0 Drivers

Run VM:

  1. You must run vm for the first time with option: "Detachable Start" enter image description here

Note: Only for Mate Desktop Environment 1.20.1 (check with command: ~$ mate-about), if when running the VM your desktop bar is blocked (you can not access the menu and other functions), ignore it. When restarting the PC it will be fixed. However, if you need urgent access to your application menu, open the terminal and execute:

~$ killall mate-panel
  1. Install Virtualbox Guest Additions in VM (without 3D) and restart the vm
  2. Restart PC/Laptop and now you can run your VM with "Normal Start" or another option.

Important:

For PC/laptop/server with Intel Chipset or Graphic Card, read HERE

For previous versions of Ubuntu 18.04.x with Intel Graphic Card, see HERE

See discussion on this problem HERE

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.