Copy and paste not working in Virtualbox

Sometimes, the copy/paste or the shared clipboard does not work from your host and guest operating system.

Here is how I fixed it on mine. (host OS is Windows 10 and guest OS is openSUSE Leap 42.3).

  • Insert the VirtualBox Guest Additions cd image into the guest OS.
  • Reinstall the Guest Additions using the command below.

sudo sh ./VBoxLinuxAdditions.run

  • Restart the guest OS. And voila, it works.
Advertisements

Update VirtualBox Guest Additions on openSUSE Leap 42.3

You just updated your VirtualBox to the latest version. But your openSUSE virtual machine is still using the old version of the Guest Additions? This causes VirtualBox to display a nagging message asking you to update.

How do you update the Guest Additions on VirtualBox?

  • Insert the Guest Additions CD image from the Devices menu.
  • Type the command zypper in kernel-devel gcc make.
  • Go to the folder of the Guest Additions and run the installer:
    • sh ./VBoxLinuxAdditions.run

I got the following output:

vhcalnplci:/run/media/pravin/VBox_GAs_5.2.6 # sh ./VBoxLinuxAdditions.run
Verifying archive integrity… All good.
Uncompressing VirtualBox 5.2.6 Guest Additions for Linux……..
VirtualBox Guest Additions installer
Removing installed version 5.2.6 of VirtualBox Guest Additions…
Copying additional installer modules …
Installing additional modules …
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel “header” files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
kernel-default-devel kernel-default-devel-4.4.92-31
VirtualBox Guest Additions: Running kernel modules will not be replaced until the system is restarted
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: modprobe vboxsf failed
You may need to restart the Window System (or just restart the guest system)
to enable the Guest Additions.

 

I went to Yast and installed Linux Kernel Development as shown below and rebooted.

Screenshot_20180123_182829.png

But the installer was still giving the same error.

The commands zypper in kernel-devel gcc make also did nothing as the packages were already installed.

Then I ran the command: zypper up

This command updated openSUSE and installed some new packages.

And finally when I rebooted the VM, and checked the version of the Guest Additions, the output was as shown below:

pravin@vhcalnplci:~> sudo /usr/sbin/modinfo vboxguest
[sudo] password for root:
filename: /lib/modules/4.4.104-39-default/misc/vboxguest.ko
version: 5.2.6 r120293
license: GPL
description: Oracle VM VirtualBox Guest Additions for Linux Module
author: Oracle Corporation
srcversion: AFB4A2952FE3E924883277D
alias: pci:v000080EEd0000CAFEsv00000000sd00000000bc*sc*i*
depends:
vermagic: 4.4.104-31-default SMP mod_unload modversions

The Guest Additions had been successfully updated.

 

 

Create a Clone of a vm in VirtualBox

When you are working with virtual machines, you will no doubt create snapshots. These take a lot of space.

For example, you can see that the Snapshots folder below is taking almost 7 times the size of the virtual disk image.

snapshots.png

You can use the Clone functionality in VirtualBox to merge and compact all the snapshots to a new VM containing a single VDI file.

Below are the steps to follow:

  • If your vm is on, turn it off. The clone command will only work on a turned off vm.
  • Right-click on the vm and choose Clone.

clone-right-click.png

  • Give a new name for the clone machine and accept the defaults.

clone - 1

clone type

clone - snapshots.png

The cloning process will begin.

Cloning process.png

The new cloned vm is now created. In my case, I saved 10Gb of disk space.

  • The old vm can now be deleted.

macOS does not boot in Virtualbox – vm is terminated

You have downloaded macOS High Sierra tactig.com or techsviewer.com and installed it on VirtualBox. Only to see that it cannot boot or virtual machine is terminated.

Error message you might see in the logs:

Changing the VM state from ‘DESTROYING’ to ‘TERMINATED’

This is how I resolved it:

  • Under general settings, set the Version to Mac OS (64-bit).

settings os type.png

  • Under Motherboard, set Chipset to PIIX3.

system.png

  • Under Acceleration, set Paravirtualisation Interface to KVM.

acceleration.png

Now, you will be able to boot into macOS using virtualbox.