Posts Tagged ‘virtualbox’

Articles

Run GUI from virtual machine

In howto on Jan 22, 2016 by theoryl Tagged: , , ,

To run GUI applications such as Firefox from within a VirtualBox guest using Vagrant, do

vagrant ssh -- -X

Make sure X11 server has been installed on the guest VM, and that /etc/sshd_config has the line:

X11Forwarding yes

Also make sure the environment variable DISPLAY is set:

echo $DISPLAY

Typically it’s set to something like localhost:0.0 or localhost:10.0.

Articles

No guest additions were detected on the base box for this VM!

In howto on Jan 18, 2016 by theoryl Tagged: , ,

If you run VirtualBox and Vagrant, you might have seen this error message:

    default: No guest additions were detected on the base box for this VM! Guest
    default: additions are required for forwarded ports, shared folders, host only
    default: networking, and more. If SSH fails on this machine, please install
    default: the guest additions and repackage the box to continue.
    default:
    default: This is not an error message; everything may continue to work properly,
    default: in which case you may ignore this message.
    default: No guest additions were detected on the base box for this VM! Guest
    default: additions are required for forwarded ports, shared folders, host only
    default: networking, and more. If SSH fails on this machine, please install
    default: the guest additions and repackage the box to continue.
    default:
    default: This is not an error message; everything may continue to work properly,
    default: in which case you may ignore this message.

After some Google searches, I found that it’s usually related to /etc/udev/rules.d/70-persistent-net.rules. See https://github.com/mitchellh/vagrant/issues/997, https://github.com/mitchellh/vagrant/issues/3341. But that was not the case for me. Note: this only happens to me if I do vagrant reload (or equivalently vagrant halt and subsequently vagrant up). It does not happen when i do vagrant up for the first time or vagrant destroy then vagrant up.

Although it could not detect the VirtualBox guest, Vagrant still makes the SSH connection. After vagrant ssh, I’m logged in on the VirtualBox guest. Doing a lsmod | grep vbox yields nothing. So, I realized this happens to me because I ran yum update, which updated the kernel. But the new kernel does not have the VirtualBox guest additions, so VirtualBox could not detect the guest after reboot.

In order to fix it, follow the instructions on https://docs.vagrantup.com/v2/virtualbox/boxes.html to reinstall VirtualBox guest additions.

wget http://download.virtualbox.org/virtualbox/5.0.12/VBoxGuestAdditions_5.0.12.iso
sudo mkdir /media/VBoxGuestAdditions
sudo mount -o loop,ro VBoxGuestAdditions_5.0.12.iso /media/VBoxGuestAdditions
sudo sh /media/VBoxGuestAdditions/VBoxLinuxAdditions.run
rm VBoxGuestAdditions_5.0.12.iso
sudo umount /media/VBoxGuestAdditions
sudo rmdir /media/VBoxGuestAdditions

If the installation failed, check if all the necessary packages are installed on the guest (Scientific Linux OS for me).

sudo yum -y install kernel-devel gcc make perl
sudo yum -y clean all

Articles

Install VirtualBox and Vagrant on Linux Mint 17.3

In howto on Jan 16, 2016 by theoryl Tagged: , , , , , ,

Another day working with virtual machines, another install log. My host machine is Linux Mint 17.3, based on Ubuntu Linux 14.04. The guest machine I’m planning to use is CentOS 6.7.

Firstly I have to install VirtualBox 5.0. Oracle provides pre-built VirtualBox package to Debian/Ubuntu distros, see here. My installation notes:

# Add /etc/apt/sources.list.d/virtualbox.list
sudo vim /etc/apt/sources.list.d/virtualbox.list

# Ubuntu Trusty
#deb http://download.virtualbox.org/virtualbox/debian trusty contrib

# Add the Oracle public key
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

sudo apt-get update
sudo apt-get install virtualbox-5.0

Secondly I have to install Vagrant by HashiCorp. The latest version is available for download as .deb packages.

# Download
wget https://releases.hashicorp.com/vagrant/1.8.1/vagrant_1.8.1_SHA256SUMS
wget https://releases.hashicorp.com/vagrant/1.8.1/vagrant_1.8.1_x86_64.deb

# Verify SHA256 checksums
sha256sum -c vagrant_1.8.1_SHA256SUMS

# Install
sudo dpkg -i vagrant_1.8.1_x86_64.deb

Thirdly, install Packer also by HashiCorp. Download the .zip file that contains the binary programs.

# Download
wget https://releases.hashicorp.com/packer/0.8.6/packer_0.8.6_linux_amd64.zip
wget https://releases.hashicorp.com/packer/0.8.6/packer_0.8.6_SHA256SUMS

# Verify SHA256 checksums
sha256sum -c packer_0.8.6_SHA256SUMS 

# Unzip
unzip packer_0.8.6_linux_amd64.zip

# Add the executables to $PATH
export PATH=$PATH:$PWD

You can also download pre-built Vagrant boxes from Hashicorp Atlas. For instance, here is an official Ubuntu Server 14.04 LTS image: https://atlas.hashicorp.com/ubuntu/boxes/trusty64

Articles

Virtualization is so easy it’s unreal [Guest: Ubuntu 8.04, Host: Leopard]

In howto on May 31, 2008 by theoryl Tagged: , , , ,

I finally decided to use VirtualBox, a free virtualization solution developed by Innotek and later bought by Sun, to install Ubuntu on top of my Macbook. Initially I would like to perform dual boot. But, one thought prevented me: “Why would you buy the expensive Macbook to install Ubuntu?” Indeed, why would you want to use Ubuntu only on Macbook is the question.

However, I’m not completely satisfied with Mac OS X Leopard — there are shortcomings despite all the wonderful picture Apple has tried to paint. I should talk about them in more details in a new post, however, here are a few:

  1. No way to mount a remote server via SSH;
  2. Its terminal is not a real terminal, but it’s just an application that is subject to bugs/crashes;
  3. I would like to install softwares from repositories, instead of each application having its version checking;
  4. Safari is very inflexible! Firefox 2 is not stable and looks ugly on a Mac;
  5. Any Windows user will complain about the prices of useful softwares and the lack of open source softwares;
  6. This is more of a Microsoft problem, but the extremely unstable Office Mac (2004 & 2008) really freaked me out!

Read More »