- Saya sediakan tulisan ini sebagai nota untuk rujukan saya sendiri.
- I used the command provided in my previous post applicable for Linux (UEFI) to load the Live CD.
- Walaupun tiada keperluan kerana saya memang sudah menggunakan sistem ini sebagai sistem operasi utama saya, tetapi apa yang saya catatkan ini berguna untuk saya aplikasikan bagi tujuan pemasangan di komputer riba sebagai hos di lain-lain masa. Pun begitu, sekiranya tuan / puan membaca dan menggunakan nota saya ini sebagai rujukan, perlu saya ingatkan bahawa akan ada beberapa perkara yang perlu dilaras mengikut keadaan misalnya sambungan WiFi tidak terpakai dalam VM tetapi ia perlu dikonfigurasi bagi sistem hos.
Sila pastikan sistem hos sudah bersambung dengan rangkaian Internet.
Windows 11: Ada beberapa perkara yang perlu dilakukan untuk memasang VM Windows 11
. Hal ini adalah diakibatkan oleh cip komputer (microcontroller) yang dilekatkan kepada motherboard di dalam kebanyakan peranti moden sekarang ini yang dinamakan sebagai Trusted Platform Module (TPM). Perlu pasang pakej swtpm
terlebih dahulu sama ada dari git
stefanberger / swtpm atau dari distribusi masing-masing. Arch Linux
ada menyediakan pakej ini dalam repositori community.
Ada sesetengah orang, sebelum mula bereksperimentasi dengan pemasangan di mesin sebenar, mesti cuba melalui mesin maya dulu. Manalah tahu, kot-kot ada yang mahu cuba belajar dual-boot Windows dengan sistem Linux kan?
Jadi di sini, saya terangkan sikitlah cara untuk load live CD sistem operasi Linux dengan UEFI
dibolehdayakan. Sebagaimana biasa, cedok dari ArchWiki
-lah.
Oleh sebab saya gunakan Arch Linux
, maka di sini juga saya akan gunakan live CD Arch Linux sebagai demo.
Merata-rata mencari pelbagai sumber rujukan demi membolehkan perkara-perkara yang saya hajati berikut:-
- Pemasangan melalui QEMU/KVM secara manual.
- Penting perkara di atas ini kerana mahu set up
samba
untuk perkongsian direktori / fail.Satu-satunya kaedah untuk berkongsi direktori / fail apabila menggunakan aplikasi GUI virt-manager / virt-viewer
melalui Spice WEBDAV Daemon
adalah tidak stabil bagi saya. Disebabkan itu, saya beralih kepada kaedah manual ini yang membenarkan opsyen medium kepada samba
.
- Dan dalam masa yang sama, masih boleh set up
Spice Client
demi memperolehi kemudahan menyalin (Clipboard; copy & paste) di antara kedua-dua sistem hos dan tetamu.
Sila pastikan sistem hos sudah bersambung dengan rangkaian Internet.
Hantaran kali ini berkisar pemasangan Windows di mesin maya.
This post is awfully outdated.
I honestly am not in the state where I can write a neat introduction for this specific action so I will just proceed to the steps I took for having this successfully done.
- Installation is done on
Logical Volume Manager (LVM)
partition; - Boot loader used is
Grub2
; - This is actually specifically set up to show how to resize a partition without losing any data which will be explained in the next entry. WARNING! Only tested on
EXT4
formatted partition.
The step-by-step instructions are as follows:-- I installed
ovmf
by following the instructions specified on the archwiki
; - Then proceeded to boot the
archiso
on QEMU
.
This is the command that I used:-
qemu-system-x86_64 -enable-kvm -m 2G \
-device intel-hda -device hda-duplex -device virtio-balloon \
-drive if=pflash,format=raw,readonly=on,file=/usr/share/edk2-ovmf/x64/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=/path-to-my_uefi_vars.fd \
-drive file=/path-to-linux.img,if=virtio \
-virtfs local,path=/path-to-shared-folder,mount_tag=hostshare,security_model=none,id=fsdev0 \
-cdrom /path-to-archlinux-x86_64.iso -boot d
I explain below what the commands are used for:-- -device intel-hda -device hda-duplex: I made it a habit to have the sound device loaded even though I do not need it for my VM;
- the next two lines:
To enable
UEFI
support as instructed in the archwiki; & - the next two lines before the last line:
Virtio
loaded to enable its block device as well as folder/file
sharing from Host OS to Guest OS.
- Once booted, I created an
ESP
partition as well as a Linux LVM
partition with gdisk
. Both were formatted as FAT32
and EXT4
respectively;This is how it looks like when loading the archiso on UEFI bootloader with QEMU/KVM. Do ping a website like google.com to see if the VM has network connected. Here, I ran lsblk
to see the available block devices. Obviously the last line is the virtual disk available which was created before loading the VM.
I then ran gdisk
(my favorite table partition app) of that particular block device intended for the VM, printed the list of partition which surely is empty and created a new partition for ESP which is required for UEFI bootloader. The same thing happened here. Another partition created to install Arch Linux there. Confirming the partitions available and their type before proceeding with the installation. Here, the ESP partition was formatted with FAT32 filesystem, and LVM building blocks were created specifically for Arch Linux system with EXT4 filesystem. - I mounted the
LVM
partition on /mnt, created a mount point for a shared folder and mounted it through the 'hostshare
' mount_tag
(I did this to copy all the base packages installed on Host OS into the Guest OS so that I no longer needed to wait for the packages to be downloaded) and continued with the general installation.:exclamation: Command for mounting hostshare:-
mount -t 9p -o trans=virtio,version=9p2000.L hostshare /mnt/share
Part of these steps may be seen in the images below: - Since Arch Linux was installed on a LVM partition, '
lvm2
' needs to be added to 'HOOKS
' line in /etc/mkinitcpio.conf
file before running mkinitcpio:- - After that, I installed
grub
(grub2) as well as efibootmgr
and add 'lvm
' to a line where it says 'GRUB_PRELOAD_MODULES
' in /etc/default/grub
file. Next, I mounted the ESP
partition on /mnt/boot
and run the following commands:-
grub-install --target=x86_64-efi --efi-directory=/mnt/boot --boot-directory=/mnt/boot --bootloader-id=GRUB
grub-mkconfig -o /mnt/boot/grub/grub.cfg
Basically, these are all the actions done to have a bootable Arch Linux installed on QEMU/KVM with UEFI enabled. Therefore, I stop at this point and will continue with 'resizing the partition without losing data' in my next post.