• qemu install

    From Valentin =?utf-8?B?VmlkacSH?=@21:1/5 to All on Sun May 17 21:10:02 2020
    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?

    --
    Valentin

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Viktor Mihajlovski@21:1/5 to All on Mon May 18 18:50:02 2020
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Valentin =?utf-8?B?VmlkacSH?=@21:1/5 to Benjamin Jakob Zimmermann on Mon May 18 20:10:02 2020
    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.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).

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Benjamin Jakob Zimmermann@21:1/5 to Viktor Mihajlovski on Mon May 18 19:40:03 2020
    This is a multi-part message in MIME format.
    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.


    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
    <div class="moz-cite-prefix">On 18/05/2020 18:17, Viktor Mihajlovski
    wrote:<br>
    </div>
    <blockquote type="cite"
    cite="mid:dbe99f53-739b-90da-c8b9-8a6fe8cce935@linux.ibm.com">On
    5/17/20 8:57 PM, Valentin Vidić wrote:
    <br>
    <blockquote type="cite">Hi,
    <br>
    <br>
    I'm trying to install a s390x VM using qemu:
    <br>
    <br>
    $ qemu-system-s390x -machine s390-ccw-virtio -nographic \
    <br>
       --cdrom debian-10.4.0-s390x-netinst.iso \
    <br>
       -kernel boot/linux_vm -initrd boot/root.bin -append
    init=/bin/sh
    <br>
    <br>
    but it doesn't seem to work - there is no network, cdrom or
    disk.
    <br>
    Should this work or is this usecase not supported?
    <br>
    <br>
    </blockquote>
    <br>
    I'd recommend to try virt-install, see
    <a class="moz-txt-link-freetext" href="http://kvmonz.blogspot.com/p/knowledge-use-virt-install-for-kvm.html">http://kvmonz.blogspot.com/p/knowledge-use-virt-install-for-kvm.html</a>.
    virt-install will set up the VM in a proper way.
    <br>
    <br>
    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.
    <br>
    <br>
    Chance for success will probably increase with the currency of the
    QEMU used.
    <br>
    <br>
    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
    </blockquote>
    <p><br>
    </p>
    <p>I mounted the s390x installation media/iso (debian stretch) on
    'loopdir'. Installed straight to hd (eckd), should work like this
    on image files, too.</p>
    <p>Network script:</p>
    <p>&lt;code&gt;<br>
    </p>
    <p>$ cat <span>qemu-ifup</span>
    </p>
    <p class="MsoNormal"><span>#!/bin/sh</span></p>
    <p class="MsoNormal"><span lang="EN-US">set -x</span></p>
    <p class="MsoNormal"><span lang="EN-US"> </span></p>
    <p class="MsoNormal"><span lang="EN-US">switch=inst0</span></p>
    <p class="MsoNormal"><span lang="EN-US"> </span></p>
    <p class="MsoNormal"><span lang="EN-US">if [ -n "$1" ];then</span></p>
    <p class="MsoNormal"><span lang="EN-US">        # tunctl -u `whoami`
    -t $1 (use ip tuntap instead!)</span></p>
    <p class="MsoNormal"><span lang="EN-US">        ip tuntap add $1
    mode tap user `whoami`</span></p>
    <p class="MsoNormal"><span lang="EN-US">        ip link set $1 up</span></p>
    <p class="MsoNormal"><span lang="EN-US">        sleep 0.5s</span></p>
    <p class="MsoNormal"><span lang="EN-US">        # brctl addif
    $switch $1 (use ip link instead!)</span></p>
    <p class="MsoNormal"><span lang="EN-US">        ip link set $1
    master $switch</span></p>
    <p class="MsoNormal"><span lang="EN-US">        exit 0</span></p>
    <p class="MsoNormal"><span>else</span></p>
    <p class="MsoNormal"><span>        echo "Error: no interface
    specified"</span></p>
    <p class="MsoNormal"><span>        exit 1</span></p>
    <p class="MsoNormal"><span>fi</span></p>
    <p class="MsoNormal"><span>&lt;/code&gt;</span></p>
    <p class="MsoNormal"><span>Call to qemu:</span></p>
    <p class="MsoNormal"><span>&lt;code&gt;</span></p>
    <p class="MsoNormal"><span>$ </span><span><span lang="EN-US">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 </span></span><span><span
    lang="EN-US"><span lang="EN-US">-append
    'debian-installer/allow_unauthenticated=true'</span></span></span></p>
    <p>This works on a z13 and z14. Works also fine with clefOS (CentOS
    clone).</p>
    <p><br>
    </p>
    <p>Best,</p>
    <p>Ben.<br>
    </p>
    </body>
    </html>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Valentin =?utf-8?B?VmlkacSH?=@21:1/5 to Viktor Mihajlovski on Mon May 18 20:20:02 2020
    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-kernel@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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Viktor Mihajlovski@21:1/5 to All on Tue May 19 11:30:01 2020
    On 5/18/20 8:00 PM, Valentin Vidić wrote:
    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.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).

    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.

    I glanced over the d-i config and udebs. It seems that with buster the virtio-modules udeb was removed under the assumption that the virtio
    modules are to be found in nic-modules and scsi-modules.
    Unfortunately, those don't include the virtio modules for s390x.
    Would you care to open a defect against d-i?
    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?


    --
    Kind Regards,
    Viktor

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Viktor Mihajlovski@21:1/5 to All on Tue May 19 16:40:02 2020
    On 5/18/20 8:00 PM, Valentin Vidić wrote:
    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.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).

    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?

    I tried to install under z/VM with the same debootstrap failure. It
    seems that it would be necessary to add perl to the list of bootstrap
    packages in order to satisfy the s390-tools depends.

    --
    Kind Regards,
    Viktor

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Valentin =?utf-8?B?VmlkacSH?=@21:1/5 to Viktor Mihajlovski on Tue May 19 17:10:04 2020
    On Tue, May 19, 2020 at 04:18:06PM +0200, Viktor Mihajlovski wrote:
    I tried to install under z/VM with the same debootstrap failure. It seems that it would be necessary to add perl to the list of bootstrap packages in order to satisfy the s390-tools depends.

    Yes, not sure what is the problem there, perhaps s390-tools needs to use perl-base instead?

    --
    Valentin

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Valentin =?utf-8?B?VmlkacSH?=@21:1/5 to Viktor Mihajlovski on Tue May 19 19:20:02 2020
    On Tue, May 19, 2020 at 11:07:48AM +0200, Viktor Mihajlovski wrote:
    I glanced over the d-i config and udebs. It seems that with buster the virtio-modules udeb was removed under the assumption that the virtio modules are to be found in nic-modules and scsi-modules.
    Unfortunately, those don't include the virtio modules for s390x.
    Would you care to open a defect against d-i?

    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=961057
    debian-installer: qemu-system-s390x installation fails due to missing modules

    --
    Valentin

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Valentin =?utf-8?B?VmlkacSH?=@21:1/5 to All on Tue May 19 20:30:01 2020
    On Mon, May 18, 2020 at 08:00:41PM +0200, Valentin Vidić wrote:
    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

    I got a suggestion to fix the console problem by patching the driver
    instead of the installer:

    https://lkml.org/lkml/2020/5/19/854

    --
    Valentin

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Viktor Mihajlovski@21:1/5 to All on Wed May 20 12:40:01 2020
    On 5/19/20 5:02 PM, Valentin Vidić wrote:
    On Tue, May 19, 2020 at 04:18:06PM +0200, Viktor Mihajlovski wrote:
    I tried to install under z/VM with the same debootstrap failure. It seems
    that it would be necessary to add perl to the list of bootstrap packages in >> order to satisfy the s390-tools depends.

    Yes, not sure what is the problem there, perhaps s390-tools needs to use perl-base instead?


    FWIW, lscpumf and chcpumf use the Data::Dumper package which require the
    full perl setup. Perhaps it would make sense to split s390-tools into a
    basic package containing the tools needed for device setup and an
    extension package with all the additional stuff. That would be up to the maintainer.

    --
    Kind Regards,
    Viktor

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Valentin =?utf-8?B?VmlkacSH?=@21:1/5 to Viktor Mihajlovski on Wed May 20 13:00:01 2020
    On Wed, May 20, 2020 at 11:40:04AM +0200, Viktor Mihajlovski wrote:
    FWIW, lscpumf and chcpumf use the Data::Dumper package which require the
    full perl setup. Perhaps it would make sense to split s390-tools into a
    basic package containing the tools needed for device setup and an extension package with all the additional stuff. That would be up to the maintainer.

    Right, looks like s390-tools also needs some updating to new version. Do
    you know who works on the package these days?

    --
    Valentin

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Valentin =?utf-8?B?VmlkacSH?=@21:1/5 to All on Wed May 20 13:00:01 2020
    On Tue, May 19, 2020 at 08:26:17PM +0200, Valentin Vidić wrote:
    I got a suggestion to fix the console problem by patching the driver
    instead of the installer:

    https://lkml.org/lkml/2020/5/19/854

    And unfortunately rejected for historical reasons :)

    --
    Valentin

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)