Install Ubuntu core on a system

Hi, First i install the QEMU-kvm on a Ubuntu base machine and install the Ubuntu core 20 on KVM and it is successfully booted.

##############qemu-system-x86_64 -enable-kvm -smp 2 -m 1500 -netdev user,id=mynet0,hostfwd=tcp::8022-:22,hostfwd=tcp::8090-:80 -device virtio-net-pci,netdev=mynet0 -drive file=/home/vehant/Desktop/ubuntu-core-20-amd64.img,format=raw -drive file=/usr/shar/OVMF/OVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on -vga qxl#############

I have mentioned the command which help me to run ubuntu core But but i am facing problem configure the network settings. Can anyone suggest me how can i bridge the network . and once this is resolved i can ssh on Ubuntu core. OR you have an another idea then you can guide me . I also build the Ubuntu-core-image.img (kernel, gadget… snaps) and dd to the external drive. But i have not a raspberry Pi board.

Do you actually need to connect it via bridge ?

If all you want to do is connect via ssh, and have basic egress from the virtual process then the command you have above is fine.

It specifies user networking, so no bridge is required, it’s all done via a userland process something called Slirp. User network supports packet forwarding for tcp and udp protocols, and in the above command you are doing that for ssh and standard http ports: hostfwd=tcp::8022-:22,hostfwd=tcp::8090-:80

All you need to do to connect via ssh is:

ssh someone@localhost -p 8022

You will need to have configured the user via console-conf fist though, otherwise there is no user to ssh as.

Details about QEMU user mode networking here: https://wiki.qemu.org/Documentation/Networking#User_Networking_.28SLIRP.29

Cheers, Just

Hi @Ga1,

Response might be little late : I had similar requirement -> Bridge to one of the interfaces in host machine. What I did was below:

  1. Convert the KVM img into vdi image. This is two step procedure.

    qemu-img convert ubuntuCore.img ubuntuCore.bin

    vboxmanage convertdd ubuntuCore.bin ubuntuCore.vdi

    vboxmanage modifyhd ubuntuCore.vdi --resize sizeInMB

  2. Bring up a new VM in virtualbox - Use the above vdi as disk - Remember to use EFI image

And boot. It will reboot a couple of times before you hit the configuration menu.

Thanks, Bhuvan