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:
[email protected]">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><code><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></code></span></p>
<p class="MsoNormal"><span>Call to qemu:</span></p>
<p class="MsoNormal"><span><code></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)