My current use for this VM is to run ansible. I use SSH to access the VM (both for running commands and transferring files), so don't bother running a GUI on it, or shared folders.

This document was tested with VirtualBox v5.0.20 r106931, running under Windows 7, and installing AlpineLinux v3.3.3 x64. It is assumed that VirtualBox is already installed.

Obtain installer ISO

Go to the downloads section of and download the 64-bit "Standard ISO" - I got alpine-3.3.3-x86_64.iso - save it somewhere you can find it again.

Setup VM

The blank machine should now be created, and will be listed in the VirtualBox window, on the left. Right-click on the machine and choose "Settings". Configure as follows:

Basic Alpine Linux Install

Run "setup-alpine", and configure as follows:

Wait for it to install...

Now run "poweroff" to shutdown the VM - this is necessary in order to reboot into the installed system, so we can install things there.

Remove CD

In the main VirtualBox window, right-click on the machine and choose "Settings". Reconfigure as follows:

Update Packages

Start the VM. When it has finished booting, the login prompt should show the hostname you selected (instead of "localhost"). Login as "root", using the password you setup.

Use vi to edit the repositories - uncomment all the URL lines to enable them all.

vi /etc/apk/repositories

It should look something like this (but probably different URLs, depending on which ones were detected as being fastest for you):


Update the package list and upgrade what has already been installed:

apk update
apk upgrade

The base install at this stage will have used about 25MB of the boot partition (nominally about 100MB, but 92.8MB reported), 512MB as swap, and 270MB of the root partition - if the base disk was 2GB, about 1GB is free on the root drive.

Setup User and Sudo

Create the sudo group, create a non-root user (use whatever username you like, instead of "otheruser"), and add the new user to the sudo group:

addgroup sudo
adduser otheruser
adduser otheruser sudo

Install sudo

apk add sudo

Run "visudo" and remove the "#" comment character from the 2nd line in this group so it looks like:

## Uncomment to allow members of group sudo to execute any command
%sudo ALL=(ALL) ALL

Setup VirtualBox Drivers

The VirtualBox drivers improve performance of a VM running under VirtualBox.

apk add virtualbox-guest-modules-grsec virtualbox-additions-grsec

Reboot the VM by typing "reboot".


You should now be able to login as the non-root user you created (using the non-root password you provided).

Once logged in, you should be able to execute commands as root by using sudo (and the non-root user password), eg. "sudo apk update" - if sudo is not working correctly, it will give an error, eg. if you weren't using sudo at all:

testvm:~$ apk update
ERROR: Unable to lock database: Permission denied
ERROR: Failed to open apk database: Permission denied

If sudo is working correctly, the command will execute, eg.:

testvm:~$ sudo apk update
v3.3.3-46-ge9c0256 []
v3.3.3-47-g150c9b2 []
v160223-1826-g4681e7d []
v160223-1826-g4681e7d []
v160223-1826-g4681e7d []
OK: 15131 distinct packages available


It should also be possible to SSH from the host machine to the VM at address "localhost" (or ""), and port "22022"