Difference between revisions of "Install Alpine on VirtualBox"

From Alpine Linux
Jump to: navigation, search
(Start the Virtual Machine)
(Install Alpine)
Line 36: Line 36:
 
With default settings in the VirtualBox this will be '''sda'''.
 
With default settings in the VirtualBox this will be '''sda'''.
  
Make the actual installation following
+
I made the actual installation using
* [[Installing Alpine on Compact Flash|CF installation instructions]], or
+
[[Installing Alpine on Compact Flash|CF installation instructions]], but
* [[Installing Alpine on HDD overwriting everything|basic HD installation]]
+
[[Installing Alpine on HDD overwriting everything|basic HD installation]] should work too.
  
{{Note|Edit <code>/media/sda1/syslinux.cfg</code> to boot from the HD (<nowiki>alpine_dev=sda1:vfat</nowiki>)
+
{{Note|With CF install remmeber to edit <code>/media/sda1/syslinux.cfg</code> to boot from the HD (<nowiki>alpine_dev=sda1:vfat</nowiki>)
 
{{Cmd|vi /media/sda1/syslinux.cfg}}
 
{{Cmd|vi /media/sda1/syslinux.cfg}}
 
}}
 
}}

Revision as of 04:17, 19 May 2010

How To Install Alpine on VirtualBox

VirtualBox is a Sun/Oracle virtualization product for x86 architecture. This document describes one way to install alpine to that platform.

Before You Start

First [{{#latestalp:alpine|url}} download latest Alpine CD image].

Create the Virtual Machine

Start by creating new VM and setting it to run linux with 2.6 series kernel.
Alpine-vbox-1.png

Set amount of memory. Since alpine runs in memory the recommended 256 MB might be too little for your needs.
Alpine-vbox-2.png

Create a disk. I wanted to emulate a Compact Flash system, so the setting is 2GB. This could be much higher if you like.
Alpine-vbox-3.png
Alpine-vbox-4.png
Alpine-vbox-5.png

Start the Virtual Machine

After Starting the virtual machine, the first run wizard will ask for a cd image. Mount your downloaded alpine.iso image here.
Alpine-vbox-1strun-1.png

Install Alpine

After Alpine boots type root to login.
Find out the virtual harddisk ID.

dmesg | grep disk

With default settings in the VirtualBox this will be sda.

I made the actual installation using CF installation instructions, but basic HD installation should work too.

Note: With CF install remmeber to edit /media/sda1/syslinux.cfg to boot from the HD (alpine_dev=sda1:vfat)

vi /media/sda1/syslinux.cfg

Configure Installation

Stop Alpine:

halt

After Alpine has been stopped, unmount the CD image in VirtualBox (Devices menu).
Start the virtual machine again and it should now boot from the virtual disk.

Setup Alpine:

setup-alpine


Configure Alpine local backup to use the virtual disk:
Edit /etc/lbu/lbu.conf to have line: LBU_MEDIA=sda1
Commit your setup:

lbu commit


Optional: to debug any problems in startup, activate the rc-system logging:

echo 'rc_logger="YES"' >> /etc/rc.conf

Results will be in /var/log/rc.log

Setup Alpine package management to cache any downloaded packages in the HD:

mkdir /media/sda1/cache

ln -s /media/sda1/cache /etc/apk/cache

lbu commit


Setup APK to use a network source and update your system:

apk update

apk upgrade

lbu commit


Development Environment

I use VirtualBox to compile and test programs for a actual Alpine box. To setup a compilation environment:

apk add alpine-sdk

lbu commit


I also like to save any local files to survive next boot:

apk add /usr/local

lbu commit

Tip: Remember to lbu commit often :-)