[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Generic & Genericcloud in qemu or kvm



On Sun, Dec 10, 2023 at 08:54:41PM +0000, bittnitt@gmail.com wrote:
> Hello... I had a few questions about running Debian Bookworm versions (generic, genericcloud) on hypervisors like qemu or kvm.
> My first problem is user and password... I tried to use cloud-init according to the instruction of this link.
> (https://cloudinit.readthedocs.io/en/latest/tutorial/qemu.html#)
> But during execution, Cloud-configs values are not read and as a result I can't login. Then I got acquainted with the virt-customize tool and I was able to put a password for root and I was able to login.
> Now another problem I have is not connecting to the Internet!!
> (I have all the necessary tools for qemu and kvm, I installed and started the nocloud version and it connects to the Internet correctly... but with the generic and genericcloud versions, I cannot connect to the Internet, and when I look with command (ip a), there is no connection)

Since there's something wrong with the network when you get access to the VM,
I'd guess that's why cloud-init failed.

> In general, how do you run these versions in qemu & kvm?

Here's what I start with, this works with cloud-init:

qemu-system-x86_64 \
    -drive file=path-to-image.qcow2,index=0,media=disk \
    -netdev user,id=hostnet0,hostfwd=tcp::2222-:22 \
    -device virtio-net-pci,netdev=hostnet0,id=net0,bus=pci.0,addr=0x3 \
    -machine accel=kvm:tcg \
    -cpu host \
    -m 1024m \
    -smbios type=1,serial=ds='nocloud-net;s=http://10.0.2.2:8000/' \
    -snapshot \
    -nographic

Ross


Reply to: