I was configuring a Linux Mint Cinnamon (LMC) 18 system to serve as host to virtual machines (VMs) via Oracle VirtualBox. This post describes the steps that I took to install and configure VirtualBox, so that I could start using it to run various VMs.
I encountered different explanations of how to install VirtualBox. For me, some were less helpful than others. At this writing, I could not be sure — I had not yet used the VM much — but for my purposes it appeared that the best way to set up VirtualBox was to issue this command in the host LMC 18 system:
sudo apt-get install virtualbox virtualbox-ext-pack vde2 virtualbox-qt
Then, if a new VM was being created, the way to install the Guest Additions was by (a) installing the guest operating system in the VM and then (b) starting the VM and choosing Devices > Insert Guest Additions CD Image from the VirtualBox top menu bar.
This post also speaks of problems I had with system crashes. I thought these were due to relative instability of LMC, and that they were solved by switching to Linux Mint MATE (LMM). Instead, I belatedly discovered that the culprit was a Linux-unfriendly video card. At the risk of being obvious, installing the needed drivers resolved that issue.
After installing VirtualBox, I went into File > Preferences > General > set Default Machine Folder. There, I designated the parent folder where I wanted to keep my VMs.
That seemed to be all that I needed or wanted to do, by way of VirtualBox installation and configuration. The following sections describe other steps that I tried, before reaching the solution just summarized. Some of these notes may be useful for people encountering various problems and error messages.
Ways to Install VirtualBox
Now that I had reinstalled LMC 17.3 and 18 a couple of times in an attempt to get past those VirtualBox problems, I knew that the first thing to do was to make an image of my system. To image this Linux system, I used Clonezilla.
Having done that, I could proceed to installation. PCSteps and others named a number of ways to install VirtualBox. One was to install virtualbox-nonfree using the LMC Software Manager (found in Start (i.e., “Menu”) button > Administration). Using Synaptic Package Manager at that same location would amount to the same thing. This was what I had done in the past, and it had worked OK. But it hadn’t worked for me in this most recent attempt — and now, in LMC 18, I saw that virtualbox-nonfree was not even listed in the standard repositories anymore.
I had noticed, using Synaptic in LMC 17.3, that the version being installed was 5.0.2. One source said that was “a far outdated version with a huge amount of bugs.” I hadn’t actually had much problem with bugs, using that version in 17.3, but I did notice that, in LMC 18, Synaptic was offering version 5.0.18 of virtualbox and of virtualbox-qt. That wasn’t so far off the current version — which, according to the VirtualBox download page, was 5.0.24.
That raised the question of why I shouldn’t just download the current 5.0.24 and forget about using Synaptic or Software Manager. This download came in the form of a Debian (.deb) file, which Start > Administration > GDebi Package Installer could easily install. (The command line alternative would be sudo dpkg -i [package name].deb.) (This talk of Debian Linux was relevant because Linux Mint was based on Debian as well as Ubuntu.)
If I took the .deb route, I would just have to choose, from the download page, the correct Ubuntu version, as there was no version specifically designed for Linux Mint. For Mint 17.3, the Ubuntu source (called its “Package Base” by the relevant Linux Mint webpage) was Trusty Tahr, also known as version 14.04); and for Mint 18, the Ubuntu Package Base was Xenial Xerus (i.e., 16.04). PCSteps explained that it was also possible to use sudo gedit /etc/apt/sources.list (or some other text editor, if gedit was not installed) to see whether the system was using the “trusty contrib” or the “xenial contrib” or some other repository.
I had become aware of a potential problem with the Debian package approach: it might not be updated properly. I had gathered that the recommended approach was to install software packages using commands. For example, the source (above) that called VirtualBox 5.0.2 “buggy” recommended instead using this command: sudo apt-get install virtualbox virtualbox-ext-pack. The package manager used in that command was apt-get, a command-line alternative to Synaptic. One source said that installing a program through a package manager, unlike installing a downloaded .deb file, would put that program on the list of packages to be updated when the user entered the simple sudo apt-get update command or used the Reload button in Synaptic — but someone else said the package manager would update programs found in the repositories listed in the /etc/apt/sources.list file, even if they had been installed in some way other than using apt-get or Synaptic.
Another advantage of using a package manager: it would draw directly from the repository, which could be more reliable than installing from some random webpage. The package manager would also take care of downloading and updating dependencies (i.e., supporting packages that one or more desired programs may need in order to run properly). It seemed said that some .deb file installations would add a repository to sources.list, taking care of at least the update issue, but it did not appear that the user could count on this. Where the .deb package was not being updated, the advice was to uninstall it before installing a newer .deb version. Overall, I was not sure whether installing .deb packages would tend to cause frequent or significant problems.
It seemed there could be other issues as well. In my previous LMC 17.3 installation, when I did download and double-click to install the .deb package for Ubuntu 14.04 (i.e., virtualbox-5.0_5.0.24-108355~Ubuntu~trusty_amd64.deb), I got a message that recommended I use a channel (presumably a Debian concept) instead. That particular error did not recur when I installed the .deb package for Ubuntu 16.04 (i.e., virtualbox-5.0_5.0.24-108355~Ubuntu~xenial_amd64.deb) in LMC 18.
In lieu of the .deb approach, there was the apt-get command recommended above (i.e., sudo apt-get install virtualbox virtualbox-ext-pack). When I ran that command in LMC 18, I got this reply:
sudo apt-get install virtualbox virtualbox-ext-pack [sudo] password for ray: Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libgsoap8 libvncserver1 virtualbox-dkms Suggested packages: vde2 virtualbox-guest-additions-iso Recommended packages: virtualbox-qt The following NEW packages will be installed: libgsoap8 libvncserver1 virtualbox virtualbox-dkms virtualbox-ext-pack 0 upgraded, 5 newly installed, 0 to remove and 251 not upgraded. Need to get 15.4 MB of archives. After this operation, 70.9 MB of additional disk space will be used. Do you want to continue? [Y/n]
I killed that. It seemed I should revise the command to include the suggested and recommended packages: sudo apt-get install virtualbox virtualbox-ext-pack vde2 virtualbox-guest-additions-iso virtualbox-qt. That revision yielded a suggestion for still more packages: vde2-cryptcab, qemu-kvm, and qemu. I was beginning to wonder where this was going to end. A search led to an explanation that, at least in Ubuntu, a recommended package was one that “is needed or recommended for normal use of the program you are installing, but the program will work without it” and that Ubuntu would install these by default, whereas a suggested package would not be installed by default and “would be considered like a ‘hey, you might find these interesting’ from the package developer.” Another source said that, in Debian, “You should always install the ‘recommended’ packages, unless you know exactly why you do not need them. Conversely, it is not necessary to install ‘suggested’ packages unless you know why you need them.”
That source also said that, in Linux Mint, recommended packages are no longer installed automatically. I tested that by running the original command (sudo apt-get install virtualbox virtualbox-ext-pack) and then trying recommended methods (i.e., just entering the command virtualbox-qt or dpkg -l | grep virtualbox-qt) to see whether the recommended virtualbox-qt package was also installed. Neither worked; the latter said “dpkg: command not found.” Dpkg was apparently a Debian package manager. I was not sure why it did not work for me here in LMC. But at any rate, Synaptic confirmed that virtualbox-qt was not installed. Synaptic’s notes accompanying virtualbox-qt explaind that it “provides the Qt based graphical user interface for VirtualBox.” Ultimately, I decided to just go ahead with the long command appearing at the start of the preceding paragraph, installing all of the suggested and recommended packages.
I was not sure that this command line approach was the right one. The VirtualBox webpage called for a more complex set of commands for Debian-based Linux distributions. These were substantially the commands that PCSteps recommended as well. I was not sure whether those more complex measures were necessary, nor why PCSteps instructed users to install virtualbox-nonfree through the Software Manager but virtualbox-4.3 through the command line. In the end, I did have a VirtualBox icon in Start > Accessories, and that icon did start VirtualBox 5.18.
Guest Additions and Extension Pack
As just noted, I ran a command to install VirtualBox as well as its Guest Additions and Extension Pack. I could have obtained newer (5.0.24) versions of all of the above from the VirtualBox website, though doing so would have subjected me to the .deb issues discussed above. I hoped that the somewhat older (5.0.18) version would function acceptably for my purposes.
For any serious and interactive use, the VirtualBox Guest Additions will make your life much easier by providing closer integration between host and guest and improving the interactive performance of guest systems. . . . They consist of device drivers and system applications that optimize the guest operating system for better performance and usability.
Examples included mouse pointer integration, shared folders, better video support, seamless windows (i.e., the ability to run a window appearing within VirtualBox as if it were part of the host operating system), time synchronization, and a shared clipboard. Those were not obviously different from the advantages provided by the Extension Pack, as described in User Manual Chapter 1: virtual USB 2.0 and 3.0 devices, for example, and disk image encryption, and some kinds of passthrough. (Passthrough was available for several kinds of hardware devices, according to User Manual Chapter 9. The basic idea was that a guest operating system (e.g., Windows 7), running in a VM, could use a piece of hardware (e.g., a PCI device) even if the host system (e.g., Linux Mint) did not have any drivers for that device.)
The key difference between the Extension Pack and the Guest Additions seemed to be that the Extension Pack was added to VirtualBox itself, and thus would be available to all VMs running in VirtualBox, whereas the Guest Additions could only be added to individual VMs, as part of the software installed in the VM, and would only be available in those VMs in which they had been installed. So, as a practical matter, I could install the Extension Pack without even having any VMs, but I could only install the Guest Additions within a running VM. The Guest Additions weren’t exactly like other software — they would be installed from the VirtualBox menu, not by running a command or clicking on an icon within the VM — but they would run like other software, and would have no effect when the VM wasn’t running.
User Manual Chapter 1 indicated that there might be extension packs created by others, in addition to the one Extension Pack produced by Oracle. But a search did not lead immediately to lists of ready-to-use extension packs produced by others, nor had I come across references to any such third-party packs. It tentatively appeared that there were no others that would be accessible to and useful for the average user.
There remained the question of how to install the Extension Pack and the Guest Additions. The User Manual said, “VirtualBox extension packages have a .vbox-extpack file name extension. To install an extension, simply double-click on the package file.” I was not sure how that advice would apply in my case, as I thought I might have installed the Extension Pack when I used the command shown in the preceding section. I was not sure how to verify this. A search failed to turn up a clear test. But then I found that, in VirtualBox, the File > Preferences > Extensions tab confirmed that Oracle VM VirtualBox Extension Pack was already installed — and so was VNC. VNC apparently referred to Virtual Network Computing, which was “a graphical desktop sharing system . . . to remotely control another computer.” This was not of immediate interest to me, and I wasn’t presently sure how I had gotten it.
The User Manual provided instructions for installing the Guest Additions. The simple approach was to start a VM, go to the VirtualBox menu bar at the top of that VM’s window, and choose Devices > Insert Guest Additions CD Image. The installation could then be verified at Machine > Settings > Storage > Controller:IDE when the VM was running. (At about this point, I had gone ahead to install LMC 18 in the VM, as described in a separate post.)
Problem: “Running in Software Rendering Mode”
When I installed the Guest Additions as just described, I got a CD icon on the VM’s desktop. The icon’s name was VBOXADDITIONS_5.0.18_106667. I wasn’t sure what it was there for. It was a little confusing, too: when I went into LMC’s nemo file manager, it didn’t show anything in my Desktop folder. I right-clicked on that icon and chose Eject. But then, when I rebooted the VM, I saw this message:
Running in software rendering mode
Cinnamon is currently running without video hardware acceleration and, as a result, you may observe much higher than normal CPU usage.
There could be a problem with your drivers or some other issue. For the best experience, it is recommended that you only use this mode for troubleshooting purposes.
A search led to an indication that this message could result from a Guest Additions issue. In Machine > Settings > Storage, I saw that there was no sign that the Guest Additions were installed. But that was a little confusing, because when I went into Machine > Session Information > Runtime Information tab > Runtime Attributes, it seemed to say that I had Guest Additions version 5.0.18_Ubuntu r106667 installed.
It seemed I had probably made a mistake in ejecting that CD icon from the desktop. I went into VirtualBox > Devices > Insert Guest Additions CD Image. This brought up a dialog that I had not seen previously:
This medium contains software intended to be automatically started. Would you like to run it?
The software will run directly from the medium “VBOXADDITIONS_5.0.18_106667”. You should never run software that you don’t trust.
If in doubt, press Cancel.
I said Run. Now another message:
VirtualBox Guest Additions installer
You appear to have a version of the VBoxGuestAdditions software on your system which was installed from a different source or using a different type of installer. If you installed it from a package from your Linux distribution or if it is a default part of the system then we strongly recommend that you cancel this installation and remove it properly before installing this version. If this is simply an older or a damaged installation you may safely proceed.
Do you wish to continue anyway? [yes or no]
I took their advice and said No. But it seemed that maybe I had achieved all I needed to achieve: the VBOXADDITIONS icon was back on the desktop, and Machine > Settings > Storage said that I did have VBoxGuestAdditions.iso installed. I rebooted the VM. When it came back up, unfortunately, it still had the “Running in software rendering mode” message.
It seemed that I would have to follow through on that last bit of advice and “remove it properly” before trying to install the Guest Additions. I was not sure what was happening here, but one possibility was that my command (above), installing virtualbox and virtualbox-guest-additions-iso and everything else at once, was not the right way to go. It looked like I was going to have to go through with a full installation or reinstallation of the Guest Additions somehow.
Uninstalling Guest Additions from Host
I guessed that one possibility was, I had run that command and installed all those packages in the host system, and that’s where VirtualBox and some of those other programs would run, but the Guest Additions did not run in the host system: they ran in the guest system, in the VM. By this reasoning, what I needed to do was to remove virtualbox-guest-additions-iso from the host system, and then try to figure out what was needed for a successful installation of the Guest Additions in the VM. It was a question of whether removing virtualbox-guest-additions-iso from the host would make any difference in the guest.
So it seemed that the starting point was to issue a command, in the host, that would remove virtualbox-guest-additions-iso. There seemed to be two slightly different commands for this purpose, provided by How-To Geek and Tom’s Hardware, respectively, as follows:
sudo apt-get --purge remove virtualbox-guest-additions-iso sudo apt-get purge virtualbox-guest-additions-iso
I shut down VirtualBox and tried the first one. It seemed to run correctly, with an indication that it was removing one package. I tried the second one. It seemed to work too, except that there was nothing left to remove. Apparently they were two different ways of doing the same thing.
It seemed that that should have taken care of it. But I was not sure whether all this screwing around had perhaps messed up some other things. How-To Geek said I could also run sudo apt-get autoremove to remove packages that would no longer be necessary, now that I had removed virtualbox-guest-additions-iso. But as I expected, that command achieved nothing; there was nothing to remove. Geek said that the clean command, which I had heard of already, was just for removing archive files that might have to be downloaded again, so I didn’t bother with that. Autoclean was apparently a variation on clean. I didn’t run either of those.
With that done, I restarted VirtualBox. It greeted me with a message:
VirtualBox – Warning
One or more disk image files are not currently accessible. As a result, you will not be able to operate virtual machines that use these files until they become accessible later.
Press Check to open the Virtual Media Manager window and see which files are inaccessible, or press Ignore to ignore this message.
I pressed the Check button. This opened the Virtual Media Manager. The problem was in the Optical Disks tab. It had a warning next to VBoxGuestAdditions.iso. I right-cliced on that item and chose Release. This gave me another dialog:
VirtualBox – Question
Are you sure you want to release the disk image file /usr/share/virtualbox/VBoxGuestAdditions.iso?
This will detach it from the following virtual machine(s): LMC 17 Basic, LMC 18 Basic.
I said Release. Then I right-clicked again, chose Remove, and got a similar message:
VirtualBox – Question
Are you sure you want to remove the virtual optical disk /usr/share/virtualbox/VBoxGuestAdditions.iso from the list of known disk image files?
Note that the storage unit of this medium will not be deleted and that it will be possible to use it later again.
I chose Remove. I closed the Virtual Media Manager and started the VM. It gave me the same “Running in software rendering mode” message. This seemed to suggest that the Guest Additions that I had installed were at least not helping in that particular problem.
Guest Additions: Another Approach
Now that I had uninstalled the Guest Additions ISO that had not seemed to be helping, I was free to try another approach. I went back into Devices > Insert Guest Additions CD Image. This gave me a message::
VirtualBox – Question
Could not find the VirtualBox Guest Additions disk image file.
Do you wish to download this disk image file from the Internet?
I said yes, download. It was a download of nearly 60MB. When it was done, I took a look in the specified folder (/home/ray/.config/VirtualBox) and confirmed the presence of VBoxGuestAdditions_5.0.18.iso. PCSteps said it wouldn’t have to be downloaded again, though that was not necessarily true: it would, if this installation died and took that folder with it. So I saved a copy in a separate folder. The next message said this:
The VirtualBox Guest Additions disk image file has been successfully downloaded from http://download.virtualbox.org/virtualbox/5.0.18/VBoxGuestAdditions_5.0.18.iso and saved locally as /home/ray/.config/VirtualBox/VBoxGuestAdditions_5.0.18.iso.
Do you wish to register this disk image file and insert it into the virtual optical drive?
I said Insert. That led to a repeat of the message quoted above (“This medium contains software intended to be automatically started. Would you like to run it?”). I clicked Run. That, in turn, gave me a repeat of another message shown above (“You appear to have a version of the VBoxGuestAdditions software on your system which was installed from a different source . . . .”). This time, I said Yes, continue anyway. Several messages appeared, indicating that this package was removing existing VirtualBox modules. At the end, it told me to hit Return and then restart the guest. I did that.
On reboot, the VM no longer displayed the “Running in software rendering mode” message. In Settings > Storage, there was a slightly different entry: not simply VBoxGuestAdditions.iso, but rather VBoxGuestAdditions_5.0.18.iso. Machine > Session Information said that I was running a similar (but possibly not exactly the same) version of Guest Additions: 5.0.18 r106667, as distinct from the 5.0.18_Ubuntu r106667 that I had observed previously (above). Finally, the VBOXADDITIONS CD icon was back on my desktop. I didn’t want it there, but wasn’t sure if I had a choice.
In short, it seemed that the command-line installation approach (above) might have installed the wrong Guest Additions, and that the right way to do it was from within the VM as just described.
Most of the configurations that I would be doing in VirtualBox would be on the level of the individual VM. Those are detailed in another post [Setting Up a Linux Mint Virtual Machine]. But there was one thing that I could set at this point. I went into File > Preferences > General > set Default Machine Folder. This would be the folder where new VMs would be created unless I specified otherwise. On my machine, that folder was at /media/veracrypt10/VirtualBox/Installed. So then, if I created a VM named Windows7VM, its top folder would be at /media/veracrypt10/VirtualBox/Installed/Windows7VM.
With that done, it was time to make a backup and a snapshot. I made the backup by closing down the VM; right-clicking on the folder containing this VM, in the nemo file manager; and choosing Compress. I made the snapshot by choosing the Snapshot button at the right side of the main VirtualBox window, clicking the little blue camera icon, and naming my snapshot to be Configured State. Then I highlighted the Current State entry, under that snapshot, and clicked the Show button. Changes made after this point would go into the Current State entry but would not be added to the original Configured State snapshot unless I chose that.
Now that I was able to start going into the VM to configure things, I had a new problem: the VM would cause the host computer to freeze up. This happened repeatedly. One thing that reliably triggered it was to attempt to change the display resolution. Sometimes I would see that the machine’s hard disk light would continue to flicker, but on the desktop I was not able to switch or close windows, shut down or reboot, or do anything else. The only solution was to use the computer’s power or reset buttons to shut down or restart.
A search demonstrated that VirtualBox users were experiencing similar freezes in a variety of situations. In my case, after much frustration, effort, and time over a period of several days, including more than one operating system reinstallation, I began to home in on the problem. When I went into the VM’s Machine > Settings > Display and disabled 3D Acceleration, as someone suggested, the problem went away — or at least I had not seen any more freezes yet.
The problem in this case was that disabling 3D Acceleration seemed to damage or disable the Guest Additions. But this was not clear. On one hand, I was back to the “Running in software rendering mode” message (above). But on the other hand, Machine > Settings > Storage reported that VBoxGuestAdditions_5.0.18.iso was still installed. I powered down the machine, went back to Machine > Settings > Storage in the main VirtualBox window, right-clicked on the VBoxGuestAdditions_5.0.18.iso, and chose Remove, and then installed a new Empty IDE Controller in that same place. I restarted the VM. The “Running in software rendering mode” message was back. I went to Devices > Insert Guest Additions CD Image, proceeded back through the Run options described above, and rebooted. The “Running in software rendering mode” message was still there.
I noticed, at this point, that a Windows 7 VM ran without problems in this system, with 3D Acceleration enabled. It was using a slightly earlier version of Guest Additions (5.0.16), and that was one possible explanation. But that line of inquiry could be wishy-washy, too: I had seen advice telling me to use newer versions of VirtualBox and other software, and I had also seen advice telling me that the older versions were more stable. I felt the more important point was probably that, as one person put it, “a lot of software rendering problems arise with using Cinnamon and it is advisable to use MATE or Xfce instead.” That person said I could at least try the MATE desktop environment, to see if that resolved the problem, without doing a whole new installation. So I made a snapshot of my VM and then, in the VM, ran the suggested commands:
sudo apt-get update sudo apt-get install mint-meta-mate
When the command was done running, I followed the advice to log out, click on the login name, click on the λ character at the upper-right corner of the sign-in dialog, change it to M, and sign in. This put me back at a VM screen that looked like the one I had just left. Was I running MATE now? To find out, as advised, I ran inxi -F. Yes, it said this was MATE 1.14.1. I shut it down and went into Machine > Settings > Display > Enable 3D Acceleration. I started it back up, went into Devices > Guest Additions CD Image, and went back through the same installation process as above. Now Machine > Settings > Storage said I had VBoxGuestAdditions_5.0.18.iso installed. I rebooted. The “Running in software rendering mode” message did not reappear. It seemed that using MATE rather than Cinnamon might solve the problem.
Based on that experience, I created a new VM, downloaded and installed Linux Mint MATE (LMM) 18 in it, and installed the Guest Additions within the VM as described above. With 3D Acceleration enabled, I went into Start > Control Center > Hardware > Displays > Resolution. Changing it did not cause the system to crash. At first, I concluded that the Cinnamon desktop was indeed the source of the crashes I had experienced. But then MATE crashed too. Eventually I realized that the solution to the system freeze issue was simply to install the needed video drivers.