This is a quick write-up about creating qemu image. The plan was to create an image for microchip libero tools to make it image for all FPGA tools(more about that later).

Installation Link to heading

Install some packages

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

Create VM Link to heading

Create the qcow2 images with 80G

qemu-img create -f qcow2 fpga.qcow2 80G

Run the ISO and and install it

qemu-system-x86_64 \
-m 4G \
-smp 4 \
-enable-kvm \
-cpu host \
-drive file=fpga.qcow2,format=qcow2 \
-cdrom 	lubuntu-24.04.2-desktop-amd64.iso \
-boot d \
-vga virtio \
-netdev user,id=usernet -device e1000,netdev=usernet \
-display gtk

Running VM Link to heading

Then we can just start the VM with specific MAC. In this command, to forward 2222 to 22 in the VM. So, we can ssh into the VM.

qemu-system-x86_64 \
-m 4G \
-smp 4 \
-enable-kvm \
-cpu host \
-drive file=fpga.qcow2,format=qcow2 \
-vga virtio \
 -netdev user,id=usernet,hostfwd="tcp::2222-:22" \
-device e1000,netdev=usernet,mac=52:54:00:11:22:33 \
-display gtk

In the VM, we have to install the SSH server. It will start the service automatically.

sudo apt install openssh-server

SSH VM Link to heading

Then we can just ssh and scp stuff into port 2222.

ssh -p 2222 username@localhost
scp -P 2222 README.md aa@localhost:/home/aa