Difference between revisions of "Install Alpine in Qemu"

From Alpine Linux
Jump to: navigation, search
(Ubuntu install hints)
(Create the Virtual Machine: Fixed raw image warning, updated alpine iso version)
Line 8: Line 8:
 
Create a disk image if you want to install Alpine Linux.
 
Create a disk image if you want to install Alpine Linux.
  
{{Cmd|qemu-img create alpine.qcow 8G}}
+
{{Cmd|qemu-img create -f qcow2 alpine.qcow2 8G}}
  
The following command starts qemu with the alpine iso image as cdrom and boot device, the default network configuration, 256 MB memory, and the disk image that was created in the previous step.  
+
The following command starts QEMU with the Alpine ISO image as CDROM, the default network configuration, 512MB RAM, the disk image that was created in the previous step, and CDROM as the boot device.
  
{{Cmd|1=qemu -cdrom alpine-2.3.6-x86_64.iso -hda alpine.qcow -boot d -net nic -net user -m 256 -rtc base=localtime}}
+
{{Cmd|1=qemu-system-x86_64 -m 512 -nic user -boot d -cdrom alpine-standard-3.10.2-x86_64.iso -hda alpine.qcow2}}
  
{{Tip|Add option <tt>--enable-kvm</tt> if your hardware support this.}}
+
{{Tip|Add option <code>-enable-kvm</code> if your hardware support this.}}
  
 
Log in as root (no password) and run: {{Cmd|setup-alpine}}
 
Log in as root (no password) and run: {{Cmd|setup-alpine}}

Revision as of 18:42, 14 September 2019

Before You Start

  • Download the latest Alpine image.
  • Install QEMU on your system (e.g. sudo apt install qemu on Ubuntu, yum -y install qemu on Fedora)

Create the Virtual Machine

Create a disk image if you want to install Alpine Linux.

qemu-img create -f qcow2 alpine.qcow2 8G

The following command starts QEMU with the Alpine ISO image as CDROM, the default network configuration, 512MB RAM, the disk image that was created in the previous step, and CDROM as the boot device.

qemu-system-x86_64 -m 512 -nic user -boot d -cdrom alpine-standard-3.10.2-x86_64.iso -hda alpine.qcow2

Tip: Add option -enable-kvm if your hardware support this.

Log in as root (no password) and run:

setup-alpine

At the question on how to use the disk select sys.

Booting the Virtual Machine

After the installation qemu can be started from disk image (-boot c) without cdrom.

qemu alpine.qcow -boot c -net nic -net user -m 256 -localtime