Running Alpine in Live mode in QEMU: Difference between revisions

From Alpine Linux
(updated)
m (typo)
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
If your just want to give Alpine Linux a try, qemu can be used without a disk image and further configuration.
If your just want to give Alpine Linux a try, qemu can be used without a disk image and further configuration.


{{Cmd|qemu -m 512 -cdrom alpine-2.3.2-x86_64.iso}}
{{Cmd|qemu -m 512 -cdrom alpine-3.2.0-x86_64.iso}}
 
You need to issue {{Cmd|grsec nomodeset}} at boot prompt to avoid being forced in graphical mode and loosing access.
 
<u>Question</u>: Is there a way to pass an apkovl as paramater at this stage?<br/>
<u>Response</u> ''to self'': Yes. I do it like this and I mount /dev/vda1 as /media/config to store the '''apkovl''' and the '''apkcache''': <pre>
mkdir -p /media/usb/images
qemu-img create -f raw /media/usb/images/mykvm.config 32M
qemu-system-x86_64 -enable-kvm -m 384 \
-name mykvm \
-cdrom /media/usb/images/alpine-3.2.0-x86_64.iso \
-drive file=/media/usb/images/mykvm.config,if=virtio \
-net lan \
-boot d &
</pre> And inside the KVM <pre>
fdisk /dev/vda
mkdosfs /dev/vda1
mkdir -p /media/config
echo "/dev/vda1 /media/config vfat rw 0 0" >> /etc/fstab
mount /media/config
setup-alpine
lbu ci
</pre> At next reboot, it will use the newly generated apkovl and apkcache stored on /dev/vda1 running in ''run-from-ram'' from the latest official ISO.
 
[[Category:Virtualization]]

Revision as of 06:22, 1 June 2015

If your just want to give Alpine Linux a try, qemu can be used without a disk image and further configuration.

qemu -m 512 -cdrom alpine-3.2.0-x86_64.iso

You need to issue

grsec nomodeset

at boot prompt to avoid being forced in graphical mode and loosing access.

Question: Is there a way to pass an apkovl as paramater at this stage?

Response to self: Yes. I do it like this and I mount /dev/vda1 as /media/config to store the apkovl and the apkcache:

mkdir -p /media/usb/images
qemu-img create -f raw /media/usb/images/mykvm.config 32M
qemu-system-x86_64 -enable-kvm -m 384 \
-name mykvm \
-cdrom /media/usb/images/alpine-3.2.0-x86_64.iso \
-drive file=/media/usb/images/mykvm.config,if=virtio \ 
-net lan \
-boot d &

And inside the KVM

fdisk /dev/vda mkdosfs /dev/vda1 mkdir -p /media/config echo "/dev/vda1 /media/config vfat rw 0 0" >> /etc/fstab mount /media/config setup-alpine lbu ci

At next reboot, it will use the newly generated apkovl and apkcache stored on /dev/vda1 running in run-from-ram from the latest official ISO.