Windows 11 Subsystem for Linux, Using

Опубликовано: 05 Ноябрь 2024
на канале: Sammy
859
20

Set up QEMU in Windows 11 Linux Sub-System (Ubunti 22) and spin-off Fedora on RISC-V Emulated architecture.
I'm your host, Sammy Hegab and feel free to connect on Linkedin   / sammyhegab  

Here are few useful links
1. RISC-V Summit Europe 2023 https://riscv-europe.org/
2. fedoraproject.org
3. https://www.qemu.org

Here are some of the steps I followed, during the live stream

Check Virtualization Extension
1. Run this command to ensure you’ve enabled virtualization on your computer. It should be above 0

egrep -c '(vmx|svm)' /proc/cpuinfo

If the output is zero then go to bios settings and enable VT-x (Virtualization Technology Extension) for the Intel processor and AMD-V for the AMD processor.

2. Update system, run the following command

sudo apt update

3. Upgrade system, run the following command

sudo apt upgrade

4. Install QEMU and Virtual Machine Manager

sudo apt install qemu-kvm qemu-system qemu-utils python3 python3-pip libvirt-clients libvirt-daemon-system bridge-utils virtinst libvirt-daemon virt-manager -y


5. Verify that Libvirtd service is started

sudo systemctl status libvirtd.service

6. Start Default Network for Networking
VIRSH is a command to directly interact with our VMs from terminal. We use it to list networks, vm-status and various other tools when we need to make tweaks. Here is how we start the default and make it auto-start after reboot.

sudo virsh net-start default

You should get network default started

7. Check status
sudo virsh net-list --all

If auto start is off type this

sudo virsh net-autostart default

8. Add user to libvert to allow access to VMs

sudo usermod -aG libvirt $USER
sudo usermod -aG libvirt-qemu $USER
sudo usermod -aG kvm $USER
sudo usermod -aG input $USER
sudo usermod -aG disk $USER

9. Reboot and you are Finished!

10. to start virtual mamager type
virt-manager

--------------------------------------------------

Next, I like you to get CPU info, you can do this by typing

cat /proc/cpuinfo

or

uname -p

1. Get a linux distro like Fedora built for risc-v, you will need the raw file and .elf (kernal file)

I downloaded fedora from https://dl.fedoraproject.org/pub/alt/...

type in terminal

wget https://dl.fedoraproject.org/pub/alt/...

2. download kernal file .elf

type in terminal
wget https://dl.fedoraproject.org/pub/alt/...

3. unarchive the xz package, and type the following
xz -d Fedora-Minimal-Rawhide-20200108.n.0-sda.raw.xz

4. Now you are ready to startup qemu-system, type/copy the following

qemu-system-riscv64 -bios none -nographic -machine virt -smp 4 -m 2G -kernel Fedora-Minimal-Rawhide-20200108.n.0-fw_payload-uboot-qemu-virt-smode.elf -device virtio-blk-device,drive=hd0 -drive file=Fedora-Minimal-Rawhide-20200108.n.0-sda.raw,format=raw,id=hd0 -device virtio-net-device,netdev=usernet -netdev user,id=usernet,hostfwd=tcp::10001-:22

Congratulations, you are all set to start developing in RISC-V.

Let me know how you get on with the basic steps :)