Difference between revisions of "Install Alpine on VirtualBox"

From Alpine Linux
Jump to: navigation, search
m (Before You Start: now a link to the download page is used)
(Doc cleanup to remove redundant sections)
Line 4: Line 4:
 
[http://virtualbox.org VirtualBox] is a Sun/Oracle  virtualization product for x86 architecture.
 
[http://virtualbox.org VirtualBox] is a Sun/Oracle  virtualization product for x86 architecture.
 
This document describes one way to install alpine to that platform.
 
This document describes one way to install alpine to that platform.
 
=Before You Start=
 
 
First [http://alpinelinux.org/downloads download latest Alpine CD image].
 
  
 
=Create the Virtual Machine=
 
=Create the Virtual Machine=
Line 31: Line 27:
  
 
=Install Alpine=
 
=Install Alpine=
After Alpine boots type ''root'' to login.
+
After Alpine boots, a typical setup will be a [[Installing Alpine on HDD overwriting everything|basic HD installation]] however you also have the option of [[Installing Alpine on Compact Flash|installing to CF]].
<br>
 
Find out the virtual harddisk ID.
 
{{Cmd|dmesg <nowiki>|</nowiki> grep disk}}
 
With default settings in the VirtualBox this will be '''sda'''.
 
 
 
I made the actual installation using
 
[[Installing Alpine on Compact Flash|CF installation instructions]], but
 
[[Installing Alpine on HDD overwriting everything|basic HD installation]] should work too.
 
 
 
{{Note|With CF install remember 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}}
 
}}
 
 
 
=Configure Installation=
 
Stop Alpine:
 
{{Cmd|halt}}
 
After Alpine has been stopped, unmount the CD image in VirtualBox (Devices menu).<br>
 
Start the virtual machine again and it should now boot from the virtual disk.<br>
 
<br>
 
Setup Alpine:
 
{{Cmd|setup-alpine}}
 
<br>
 
Configure [[Alpine local backup]] to use the virtual disk:<br>
 
Edit <code>/etc/lbu/lbu.conf</code> to have line: <code>LBU_MEDIA=sda1</code><br>
 
Commit your setup:
 
{{Cmd|lbu commit}}
 
<br>
 
'''Optional:''' to debug any problems in startup, activate the rc-system logging:
 
{{Cmd|<nowiki>echo 'rc_logger="YES"' >> /etc/rc.conf</nowiki>}}
 
Results will be in <code>/var/log/rc.log</code>
 
<br>
 
<br>
 
Setup [[Alpine package management]] to cache any downloaded packages in the HD:
 
{{Cmd|mkdir /media/sda1/cache}}
 
{{Cmd|ln -s /media/sda1/cache /etc/apk/cache}}
 
{{Cmd|lbu commit}}
 
<br>
 
[[Upgrading_Alpine_-_v1.9.x#Upgrading_an_Alpine_Linux_Hard-disk_installation|Setup APK to use a network source]] and update your system:
 
{{Cmd|apk update}}
 
{{Cmd|apk upgrade}}
 
{{Cmd|lbu commit}}
 
 
 
 
 
=Development Environment=
 
I use VirtualBox to compile and test programs for a actual Alpine box.
 
To setup a compilation environment:
 
{{Cmd|apk add alpine-sdk}}
 
{{Cmd|lbu commit}}
 
<br>
 
I also like to save any local files to survive next boot:
 
{{Cmd|lbu add usr/local}}
 
{{Cmd|lbu commit}}
 
 
 
{{Tip|Remember to <code>lbu commit</code> often :-)}}
 

Revision as of 19:19, 29 September 2011

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.

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, a typical setup will be a basic HD installation however you also have the option of installing to CF.