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

Re: qemu install



On 18/05/2020 18:17, Viktor Mihajlovski wrote:
On 5/17/20 8:57 PM, Valentin Vidić wrote:
Hi,

I'm trying to install a s390x VM using qemu:

$ qemu-system-s390x -machine s390-ccw-virtio -nographic \
   --cdrom debian-10.4.0-s390x-netinst.iso \
   -kernel boot/linux_vm -initrd boot/root.bin -append init=/bin/sh

but it doesn't seem to work - there is no network, cdrom or disk.
Should this work or is this usecase not supported?


I'd recommend to try virt-install, see http://kvmonz.blogspot.com/p/knowledge-use-virt-install-for-kvm.html. virt-install will set up the VM in a proper way.

You will need to invoke virt-install with --arch=s390x if your running on an x86 box and make sure you have the qemu-system-s390x package installed.

Chance for success will probably increase with the currency of the QEMU used.

The invocation you've reported above doesn't instantiate a virtio disk and network interface (which are the only device types supported for s390x. Similary virtual CD/DVD must be on virtio-scsi for s390x. Again, virt-install and virsh are your friends here


I mounted the s390x installation media/iso (debian stretch) on 'loopdir'. Installed straight to hd (eckd), should work like this on image files, too.

Network script:

<code>

$ cat qemu-ifup

#!/bin/sh

set -x

 

switch=inst0

 

if [ -n "$1" ];then

        # tunctl -u `whoami` -t $1 (use ip tuntap instead!)

        ip tuntap add $1 mode tap user `whoami`

        ip link set $1 up

        sleep 0.5s

        # brctl addif $switch $1 (use ip link instead!)

        ip link set $1 master $switch

        exit 0

else

        echo "Error: no interface specified"

        exit 1

fi

</code>

Call to qemu:

<code>

$ qemu-system-s390x -M s390-ccw-virtio -m 1G -smp 1 -enable-kvm -nographic -device virtio-net-ccw,netdev=mynet0 -netdev tap,id=mynet0,script=qemu-ifup -drive file=/dev/disk/by-path/ccw-0.0.xxxx -kernel loopdir/boot/linux_vm -initrd loopdir/boot/root.bin -append 'debian-installer/allow_unauthenticated=true'

This works on a z13 and z14. Works also fine with clefOS (CentOS clone).


Best,

Ben.


Reply to: