Re: qemu install

2020-05-18 Thread Valentin Vidić
On Mon, May 18, 2020 at 06:17:40PM +0200, Viktor Mihajlovski wrote:
> 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 did try to install with the virt-manager, it should be the same thing as
virt-install. But it turns out the bug is with the buster installer as I sent
in the other reply. So currently the following works:

$ virt-install --arch=s390x --name test --memory 1024 --disk none \
  --extra-args=console=ttyS0 \
  -l http://ftp.de.debian.org/debian/dists/stretch/main/installer-s390x/

but the same thing with buster is broken:

$ virt-install --arch=s390x --name test --memory 1024 --disk none \
  --extra-args=console=ttyS0 \
  -l http://ftp.de.debian.org/debian/dists/buster/main/installer-s390x/
Starting install...
Retrieving file kernel.debian...
  | 3.3 MB  00:00:00 
Retrieving file initrd.debian...
  | 9.7 MB  00:00:01 
Allocating 'virtinst-kernel.debian.mnba14e7'
  | 3.3 MB  00:00:00 
Transferring virtinst-kernel.debian.mnba14e7
  | 3.3 MB  00:00:00 
Allocating 'virtinst-initrd.debian.2q88l_1j'
  | 9.7 MB  00:00:00 
Transferring virtinst-initrd.debian.2q88l_1j
  | 9.7 MB  00:00:00 
Connected to domain test
Escape character is ^]
[1.785649] Linux version 4.19.0-9-s390x (debian-ker...@lists.debian.org) 
(gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.118-2 (2020-04-29)
[1.786919] setup: Linux is running under KVM in 64-bit mode
[1.788555] setup: The maximum memory size is 1024MB
[1.790050] cpu: 1 configured CPUs, 0 standby CPUs
[1.822704] Write protected kernel read-only data: 8976k
...
[6.148235] mip6: Mobile IPv6
[6.148389] NET: Registered protocol family 17
[6.149302] mpls_gso: MPLS GSO support
[6.151503] registered taskstats version 1
[6.152310] zswap: loaded using pool lzo/zbud
[6.154776] AppArmor: AppArmor sha1 policy hashing enabled
[6.780329] Freeing unused kernel memory: 684K
[6.780784] Write protected read-only-after-init data: 20k
[6.780870] Run /init as init process
steal-ctty: No such file or directory

And than just hangs there because of the problem with the serial port name.

-- 
Valentin



Re: qemu install

2020-05-18 Thread Valentin Vidić
On Mon, May 18, 2020 at 07:31:15PM +0200, Benjamin Jakob Zimmermann wrote:
> $ 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. -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).

Thanks for the info. Indeed it seems that things work with the stretch
image so I will try to use that.

But can we also try to fix buster and unstable images as these seem to
be broken at the moment? I have identified the following problems:

1. debian-installer fails to start on serial port due to wrong device
name (ttyS1 vs ttysclp0). I can boot with init=/bin/sh and make a
symlink but a patch is here:
https://salsa.debian.org/installer-team/rootskel/-/merge_requests/2/diffs

2. initrd does not include the required modules (virtio_net and
virtio_blk) so network and disk devices are not visible. Had to
build a new initrd with these included.

3. installation starts but at some point debootstrap fails with

May 17 20:12:05 debootstrap: dpkg: error processing package s390-tools 
(--configure):
May 17 20:12:05 debootstrap:  dependency problems - leaving unconfigured
May 17 20:12:06 debootstrap: Errors were encountered while processing:
May 17 20:12:06 debootstrap:  s390-tools
May 17 20:12:07 debootstrap: dpkg: dependency problems prevent configuration of 
s390-tools:
May 17 20:12:07 debootstrap:  s390-tools depends on perl:any.

So probably s390-tools package needs to be updated?

-- 
Valentin



Re: qemu install

2020-05-18 Thread Benjamin Jakob Zimmermann

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:



$ 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



Call to qemu:



$ 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. -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.



Re: qemu install

2020-05-18 Thread Viktor Mihajlovski

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.



--
Kind Regards,
   Viktor