Ubuntu 18.04 in VM: Desktop does not restore window size











up vote
2
down vote

favorite












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?










share|improve this question




















  • 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.
    – olivierb2
    Oct 31 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 at 11:11












  • the same problem in Ubuntu Mate 18.04.1 & virtualbox 5.2.22. Possible bug
    – ajcg
    Nov 23 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 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 at 21:38















up vote
2
down vote

favorite












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?










share|improve this question




















  • 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.
    – olivierb2
    Oct 31 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 at 11:11












  • the same problem in Ubuntu Mate 18.04.1 & virtualbox 5.2.22. Possible bug
    – ajcg
    Nov 23 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 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 at 21:38













up vote
2
down vote

favorite









up vote
2
down vote

favorite











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?










share|improve this question















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?







gnome 18.04 virtualbox






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 31 at 11:14

























asked Oct 31 at 10:01









JonBrave

246213




246213








  • 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.
    – olivierb2
    Oct 31 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 at 11:11












  • the same problem in Ubuntu Mate 18.04.1 & virtualbox 5.2.22. Possible bug
    – ajcg
    Nov 23 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 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 at 21:38














  • 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.
    – olivierb2
    Oct 31 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 at 11:11












  • the same problem in Ubuntu Mate 18.04.1 & virtualbox 5.2.22. Possible bug
    – ajcg
    Nov 23 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 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 at 21:38








1




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.
– olivierb2
Oct 31 at 10:12




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.
– olivierb2
Oct 31 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 at 11:11






@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 at 11:11














the same problem in Ubuntu Mate 18.04.1 & virtualbox 5.2.22. Possible bug
– ajcg
Nov 23 at 15:25






the same problem in Ubuntu Mate 18.04.1 & virtualbox 5.2.22. Possible bug
– ajcg
Nov 23 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 at 15:34




@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 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 at 21:38




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 at 21:38










1 Answer
1






active

oldest

votes

















up vote
0
down vote













It worked for me:




  • Ubuntu version: 18.04.1 x64 LTS Bionic Beaver

  • Desktop: Mate Desktop Environment 1.20.1 with Marco (GPU composition with Compton)

  • Kernel version: v4.15.0-39-generic

  • VirtualBox version: v5.2.22 r126460 (Qt5.9.5)

  • Oracle VM VirtualBox Extensions version: 5.2.22r126460

  • OpenGL version string: 3.0 Mesa 18.2.2 (check with command: glxinfo | grep "OpenGL version") (sudo add-apt-repository ppa:ubuntu-x-swat/updates)


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..."
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 dist-upgrade
sudo apt -y install virtualbox-5.2 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
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






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1088850%2fubuntu-18-04-in-vm-desktop-does-not-restore-window-size%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    It worked for me:




    • Ubuntu version: 18.04.1 x64 LTS Bionic Beaver

    • Desktop: Mate Desktop Environment 1.20.1 with Marco (GPU composition with Compton)

    • Kernel version: v4.15.0-39-generic

    • VirtualBox version: v5.2.22 r126460 (Qt5.9.5)

    • Oracle VM VirtualBox Extensions version: 5.2.22r126460

    • OpenGL version string: 3.0 Mesa 18.2.2 (check with command: glxinfo | grep "OpenGL version") (sudo add-apt-repository ppa:ubuntu-x-swat/updates)


    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..."
    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 dist-upgrade
    sudo apt -y install virtualbox-5.2 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
    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






    share|improve this answer



























      up vote
      0
      down vote













      It worked for me:




      • Ubuntu version: 18.04.1 x64 LTS Bionic Beaver

      • Desktop: Mate Desktop Environment 1.20.1 with Marco (GPU composition with Compton)

      • Kernel version: v4.15.0-39-generic

      • VirtualBox version: v5.2.22 r126460 (Qt5.9.5)

      • Oracle VM VirtualBox Extensions version: 5.2.22r126460

      • OpenGL version string: 3.0 Mesa 18.2.2 (check with command: glxinfo | grep "OpenGL version") (sudo add-apt-repository ppa:ubuntu-x-swat/updates)


      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..."
      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 dist-upgrade
      sudo apt -y install virtualbox-5.2 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
      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






      share|improve this answer

























        up vote
        0
        down vote










        up vote
        0
        down vote









        It worked for me:




        • Ubuntu version: 18.04.1 x64 LTS Bionic Beaver

        • Desktop: Mate Desktop Environment 1.20.1 with Marco (GPU composition with Compton)

        • Kernel version: v4.15.0-39-generic

        • VirtualBox version: v5.2.22 r126460 (Qt5.9.5)

        • Oracle VM VirtualBox Extensions version: 5.2.22r126460

        • OpenGL version string: 3.0 Mesa 18.2.2 (check with command: glxinfo | grep "OpenGL version") (sudo add-apt-repository ppa:ubuntu-x-swat/updates)


        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..."
        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 dist-upgrade
        sudo apt -y install virtualbox-5.2 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
        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






        share|improve this answer














        It worked for me:




        • Ubuntu version: 18.04.1 x64 LTS Bionic Beaver

        • Desktop: Mate Desktop Environment 1.20.1 with Marco (GPU composition with Compton)

        • Kernel version: v4.15.0-39-generic

        • VirtualBox version: v5.2.22 r126460 (Qt5.9.5)

        • Oracle VM VirtualBox Extensions version: 5.2.22r126460

        • OpenGL version string: 3.0 Mesa 18.2.2 (check with command: glxinfo | grep "OpenGL version") (sudo add-apt-repository ppa:ubuntu-x-swat/updates)


        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..."
        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 dist-upgrade
        sudo apt -y install virtualbox-5.2 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
        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







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 29 at 13:10

























        answered Nov 26 at 15:14









        ajcg

        539310




        539310






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1088850%2fubuntu-18-04-in-vm-desktop-does-not-restore-window-size%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

            Mangá

            Eduardo VII do Reino Unido