How To Install Alpine Linux On VirtualBox
How To Install Alpine Linux On VirtualBox
If you want to use the Alpine Linux but wants to give it a try before
making it the current OS of the system, you can use the VirtualBox. In
this tutorial, we will briefly explain how to install and use the Alpine
Linux on VirtualBox.
Like other Linux distributions, you can easily install the Alpine Linux
on VirtualBox.
https://linuxhint.com/install-alpine-linux-virtualbox/ 1/18
29/6/23, 02:16 How to Install Alpine Linux on VirtualBox
Now, please provide a memory for the virtual machine from your
system. Since Alpine is a small distro, it only requires a little memory.
You can run it easily by giving up to 2GB of memory, but we provided
7GB here to make it run more smoothly.
https://linuxhint.com/install-alpine-linux-virtualbox/ 3/18
29/6/23, 02:16 How to Install Alpine Linux on VirtualBox
Next, we need to create a hard disk to store the data. To do this, click on
“Create a virtual hard disk now” and proceed by clicking on “Create”.
https://linuxhint.com/install-alpine-linux-virtualbox/ 4/18
29/6/23, 02:16 How to Install Alpine Linux on VirtualBox
Proceed by selecting “VirtualBox Disk Image (VDI)” for the type of file
disk.
https://linuxhint.com/install-alpine-linux-virtualbox/ 5/18
29/6/23, 02:16 How to Install Alpine Linux on VirtualBox
https://linuxhint.com/install-alpine-linux-virtualbox/ 6/18
29/6/23, 02:16 How to Install Alpine Linux on VirtualBox
You can select a disk size of up to 10GB by default, since Alpine Linux
has a smaller size. For the system to work properly, we fixed the disk
size at 50GB.
https://linuxhint.com/install-alpine-linux-virtualbox/ 7/18
29/6/23, 02:16 How to Install Alpine Linux on VirtualBox
Now, go to Settings > System > Motherboard and tick on the “optical”
and “hard disk” options as shown in the following image:
https://linuxhint.com/install-alpine-linux-virtualbox/ 8/18
29/6/23, 02:16 How to Install Alpine Linux on VirtualBox
After making the previous settings, start the Alpine Linux by clicking
on the “Start” button. After setting everything right, you will see the
following screen when you click on “Start”.
Note: In this situation, you are using Alpine but it is still not fully
installed.
Alpine Linux also has the login. The default user on Alpine is “root”.
Login to the localhost login prompt by typing “root”.
Now, Alpine asks you to select the keyboard first. Here, we select that
keyboard by typing “us”. When prompted for the next keyboard
variation, type “us” again and press “Enter” to proceed.
https://linuxhint.com/install-alpine-linux-virtualbox/ 9/18
29/6/23, 02:16 How to Install Alpine Linux on VirtualBox
The system now asks you to enter the hostname. Here, you can enter
the hostname as per your choice.
Next, we are not going to configure the “etho” network interface. Press
“Enter” two times for automatic configuration.
When prompted for manual network configuration, type “n” and enter
for automatic configuration. Make sure that you connected to the
internet and it gives the dynamically allocated IP addresses.
To change the password for the root user, enter any strong password
that you want, twice.
Note: For security reasons, you will not see anything typed while typing
the password.
Once the password is set, our screen returns to the setup menu. When
prompted for your time zone, you have to enter the area. Use “?” to list
the appropriate list for your timezone. You will see that the list of all
the zones will appear in front of you.
https://linuxhint.com/install-alpine-linux-virtualbox/ 10/18
29/6/23, 02:16 How to Install Alpine Linux on VirtualBox
Alpine now needs to install some packages and wants to know where to
download the packages. An extensive list of mirrors is available from
which you can choose. Currently, Alpine is going through 70 packages
and sees which package is the fastest, but this process takes some time.
If you can wait, press “Enter” to find the fastest one.
https://linuxhint.com/install-alpine-linux-virtualbox/ 11/18
29/6/23, 02:16 How to Install Alpine Linux on VirtualBox
It asks you to set up the user. But for now, without setting up the user,
we proceed by pressing “Enter”. After this, it asks you for root SSH
login permission. If you need to enter a password while doing the root
SSH login, type “yes”; otherwise, proceed by typing “no”.
Finally, you must choose the disk on which you want to install the
Alpine Linux. As you can see, we have only one disk. Apart from this, we
have no other option. So, we choose “sda”.
Next, write “sys” to use the disk as the sys drive. When the system
prompts you to erase the disc, type “y” and press “Enter”.
The previous process may take some time, but Alpine is installed after
that. Finally, reboot the system by typing “reboot”.
https://linuxhint.com/install-alpine-linux-virtualbox/ 12/18
29/6/23, 02:16 How to Install Alpine Linux on VirtualBox
When Alpine restarts, you will see the name that you provided as the
system hostname. To proceed, type “root” and enter the password that
you entered earlier.
cd /etc/apk/
Here, we open the repositories using the Vi editor. For this, run the
following command:
vi repositories
Upon running the previous command, you will see the following
repositories. Out of this, we remove the “#” from the previous two
repositories to un-command them. By doing so, the repositories are
enabled for Alpine Linux.
Run the following update command to ensure that the repositories are
working correctly:
apk update
https://linuxhint.com/install-alpine-linux-virtualbox/ 13/18
29/6/23, 02:16 How to Install Alpine Linux on VirtualBox
You can see that the repositories of Alpine Linux are working correctly,
and around 17000 packages are available under it.
setup-xorg-base
This command installs all the necessary packages for the graphical
interface of Alpine Linux.
Now, we need to install the video drivers. First, we search for the video
drivers using the following command:
https://linuxhint.com/install-alpine-linux-virtualbox/ 14/18
29/6/23, 02:16 How to Install Alpine Linux on VirtualBox
Here, we only install the selected video drives which are as follows:
All the previous three video drivers are essential and are successfully
installed. These are necessary for the graphical interface of Alpine
Linux to work.
Now, let’s install some input drivers for devices like the keyboard and
mouse. We first search the input drivers in the Alpine repository using
the following command:
https://linuxhint.com/install-alpine-linux-virtualbox/ 15/18
29/6/23, 02:16 How to Install Alpine Linux on VirtualBox
Afterward, install all the gnome utilities. Here, we install all the
necessary utilities through the following command:
Now, you need to add some services. Here, we add four services (dbus,
udev, virtualbox-guest-additions, and gnome desktop manager) using
the following command:
https://linuxhint.com/install-alpine-linux-virtualbox/ 16/18
29/6/23, 02:16 How to Install Alpine Linux on VirtualBox
Finally, create a login user with a home directory. For this, provide the
username and password correctly.
Conclusion
One of the main features of Alpine Linux is its small size. Installing
Alpine Linux is tricky compared to other Linux distros. In this tutorial,
we learned the installation process of Alpine Linux on VirtualBox,
which is lengthy. After installing Alpine, we described the entire
process of its configuration.
https://linuxhint.com/install-alpine-linux-virtualbox/ 18/18