pkg install qemu-system-x86_64-headless qemu-utils wget
(incase wget
is not installed)
qemu-img create -f qcow2 alpine.qcow2 4G
wget https://dl-cdn.alpinelinux.org/alpine/v3.13/releases/x86_64/alpine-virt-3.13.2-x86_64.iso
Next, create boot.sh
or any name and add the content
qemu-system-x86_64 -smp 2 -m 2040 \
-drive file=alpine.qcow2,if=virtio \
-netdev user,id=n1,hostfwd=tcp::6379-:6379,hostfwd=tcp::9000-:9000 \
-device virtio-net,netdev=n1 \
-cdrom alpine-virt-3.13.2-x86_64.iso -boot d \
-nographic
Then, launch boot.sh
with:
bash boot.sh
Taken from HERE
Boot into the installation ISO using qemu,
Login into shell with user "root" and no password,
Create a directory with the command mkdir -p /etc/udhcpc/
Create a file /etc/udhcpc/udhcpc.conf
with the line RESOLV_CONF="no"
preventing udhcpd (Busybox' DHCP server) from overwriting /etc/resolv.conf
,
Create /etc/resolv.conf
with
nameserver 8.8.8.8
nameserver 8.8.4.4
entries,
Conclude the installation via setup-alpine
as usual.
Now press enter mutiple times to choose the default until it shows ssh and choose none
When it shows the disk selection, choose vda
( or sda
if it only shows sda
)
Then type sys
on the disk type screen
Press y and enter key
After installation, run the command:
poweroff
Edit the boot.sh
and remove the cdrom line and run the command again:
bash boot.sh
Then login with the credentials you entered in the setup
And your done!
Instead of pkg
, use apt
(in Debian or Ubuntu) or pacman -S
(in Arch Linux "if you even have one") or zypper
(in openSUSE)
Same instructions as Termux Version
Install QEmu HERE
Download Alpine HERE
Instead of boot.sh
, use boot.bat
(or any name but with .bat
)
Use the content here instead:
First setup:
qemu-system-x86_64 -smp 2 -m 2040 -drive file=alpine.qcow2,if=virtio -netdev user,id=n1,hostfwd=tcp::6379-:6379,hostfwd=tcp::9000-:9000 -device virtio-net,netdev=n1 -cdrom alpine-virt-3.13.2-x86_64.iso -boot d -nographic
Hard Disk boot:
Same as First Setup but without CDROM line Same instructions as in Termux Version