My experiences with Visopsys install on QEMU virt disk

General discussion about Visopsys.
User avatar
ronaldlees
Posts: 120
Joined: Tue May 20, 2014 5:19 pm

My experiences with Visopsys install on QEMU virt disk

Post by ronaldlees »

There seems to be an easier path (at least for me) when installing Visopsys to a QEMU virtual hard disk. I thought I'd share my experiences, so that others may benefit (or can correct me if I'm missing something). This post describes what can be done in the case where Visopsys has panic-ed during the initial installation attempt. In cases where there is no panic, the installer works fluently, and this thread is not needed at all .

I start by creating a disk, and starting QEMU with the Visopsys ISO image (in my case using a bridging technique, which could be insecure, so I do not connect to the real internet) ...

1) Create QEMU virtual disk:
qemu-img create -f raw ./visopsys.img 200M
2) Start QEMU with Visopsys cdrom (iso) image:
qemu-system-i386 -m 200M -netdev tap,id=t0,ifname=tap0,script=no,downscript=no -device pcnet,netdev=t0,id=nic0 -cdrom ./visopsys.iso -boot d -serial stdio -drive file=./visopsys.img,format=raw
Last edited by ronaldlees on Sun Jun 17, 2018 11:51 am, edited 5 times in total.
User avatar
ronaldlees
Posts: 120
Joined: Tue May 20, 2014 5:19 pm

Re: My experiences with Visopsys install on QEMU virt disk

Post by ronaldlees »

Then, when the Visopsys screen appears, I :

3) Click the "Install" button

4) Click "Partition Disks"

5) If the only disk partition showing in the dialog is the (just now new) QEMU virtual disk (hd0a) partition, then I click "Delete All" button on the bottom of dialog.

Before clicking "Delete All" - it looks like:
Reserved Space
Empty Space
hd0a FAT32
After clicking "Delete All" - it looks like:
Reserved Space
Empty Space
Last edited by ronaldlees on Sun Jun 17, 2018 11:13 am, edited 4 times in total.
User avatar
ronaldlees
Posts: 120
Joined: Tue May 20, 2014 5:19 pm

Re: My experiences with Visopsys install on QEMU virt disk

Post by ronaldlees »

6) I click on the "Empty space" line in the partitioner dialog. Then I ...

7) Click the "Create" button at the bottom of the partitioner dialog

8) Click "OK"

9) Click the "FAT32 (LBA) selection

10) Click "Select"

11) Click the "Set Active" button at bottom of partitioner dialog

12) Click the "Write Changes" button at bottom of partitioner dialog
Last edited by ronaldlees on Fri Jun 15, 2018 1:10 pm, edited 2 times in total.
User avatar
ronaldlees
Posts: 120
Joined: Tue May 20, 2014 5:19 pm

Re: My experiences with Visopsys install on QEMU virt disk

Post by ronaldlees »

13) Making sure the new FAT partition has been selected, I click the "Format" button at the bottom of the partitioner dialog. Then I ...

14) Click "FAT"

15) Click "OK"

16) Click on the "FAT32" selection

17) Click "OK" (I think twice)

18) I select the "Reserved space" line in the partitioner dialog

19) In the "Disk" menu, I click the "Write Basic MBR" menu item

20) I click "OK"

21 I click in the "File" menu to exit the partitioner
Last edited by ronaldlees on Fri Jun 15, 2018 1:13 pm, edited 4 times in total.
User avatar
ronaldlees
Posts: 120
Joined: Tue May 20, 2014 5:19 pm

Re: My experiences with Visopsys install on QEMU virt disk

Post by ronaldlees »

22) Back in the installer screen, I select the hd0a QEMU virtual disk partition as the installation target. Then I ...

23) Click "OK"

24) I deselect (uncheck) the "Format hd0a (erases all data)" box.

25) Click "OK"

26) Then I click "reboot" - and shut QEMU down.

27) I restart QEMU without the cdrom boot disk:

qemu-system-i386 -m 200M -netdev tap,id=t0,ifname=tap0,script=no,downscript=no -device pcnet,netdev=t0,id=nic0 -serial stdio -drive file=./visopsys.img,format=raw
This seems to consistently work for me. If others see an issue, please advise your suggestions.
Last edited by ronaldlees on Sun Jun 17, 2018 11:15 am, edited 1 time in total.
User avatar
ronaldlees
Posts: 120
Joined: Tue May 20, 2014 5:19 pm

Re: My experiences with Visopsys install on QEMU virt disk

Post by ronaldlees »

Note that I've used bridging for the QEMU/Visop setup. This may not be very secure, so don't do it on a live (internet connected) instance.

For the curious, this is how to quickly bridge it all together on a Linux machine:
1) I add a bridge:
brctl addbr br0

2) I may or may not want (optional):
dnsmasq --interface=br0 --bind-interfaces --dhcp-range=172.16.1.20,172.16.1.254,12h

3) ip tuntap add dev tap0 mode tap

4) ip link set tap0 up promisc on

5) I add tap0 to the bridge:
brctl addif br0 tap0

6) brctl show

7) I add eth0 to the bridge:
brctl addif br0 eth0

8) brctl show

9) ifconfig
These settings are not persistent (AFAIK) - so a reboot takes my system back to "normal" (hopefully). Note that I'm using Gentoo, so the action of these things may be different on other distros! Also, I've just started using Gentoo, so am not really a Gentoo expert either. Thus, this is not advice. Bridge at your own risk! There are other ways to do the QEMU networking, but the bridging method is easier. It's not the best way - but it is the easier one.

When Visopsys runs, it will be able to grab an IP address when I execute the "ifconfig" command, and then click on the "Enable" button.
Last edited by ronaldlees on Fri Jun 15, 2018 2:33 pm, edited 7 times in total.
User avatar
ronaldlees
Posts: 120
Joined: Tue May 20, 2014 5:19 pm

Re: My experiences with Visopsys install on QEMU virt disk

Post by ronaldlees »

DHCP action:

In Visopsys, the "ifconfig" command (if not launched with the -T (text only) switch) - will execute a dialog that can grab an IP address via the built-in DHCP client. I've noticed that (at least when running my instances) - the DHCP client does not pass the hostname back to the router / dhcpd). So, the hostname is autogenerated on the router / dhcpd as an "Unknown-EF012..." sort of name in its listings. This is not a problem, other than being a little bit hard to decipher, when comparing to other machines.

Note the -disk option I used with QEMU. This may seem funky, if you haven't used QEMU on physical disks before. QEMU normally blocks sector zero writes (where the MBR goes) - on a physical disk or QEMU raw disk, unless the -drive syntax I've shown is used.
User avatar
ronaldlees
Posts: 120
Joined: Tue May 20, 2014 5:19 pm

Re: My experiences with Visopsys install on QEMU virt disk

Post by ronaldlees »

Networking ...

This is starting to be very interesing. Andy's recent work on the system is a quantum leap for networking. I'd not really been very successful with the network stack before version 0.82. But, things are really starting to look a lot better. I noticed that previous versions of Visopsys had a telnet client, but the most recent (0.82) doesn't. I'm thinking (guessing) that Andy is getting ready for some first strokes on TCP, maybe with a modified telnet utility.

Andy: I think it's hard wired now to use only a Telnet server (port 23). Maybe you could allow for a port on the command line (makes it super good for general TCP testing) ...
User avatar
andymc
Posts: 589
Joined: Tue Nov 16, 2010 7:20 pm

Re: My experiences with Visopsys install on QEMU virt disk

Post by andymc »

Hi Ron, this is all good stuff, great to see someone experimenting with all of it.

When partitioning the disk for installation, it's weird that it shows an hd0a partition. Maybe just some residual stuff in the file? If the disk image file was all zeros then this would seem like a bit of a bug.

You don't need to select the reserved space to create an MBR, it always goes in sector 0 regardless.

As of version 0.9 networking will be enabled by default, so you won't have to go and do it manually.

The thing about the DHCP hostname missing is interesting, I think the code should be trying to set it. I'll make a note to test that out.

Yes the telnet client that was in there previously was fairly stunted. I've written a new client, and a client/server telnet library, and version 0.9 will come with a proper telnet client, at least. Not that anyone uses telnet per se anymore, but it has been a good way to test TCP, and some other protocols seem to use telnet as part of their specs. The library is the thing that might come in handy there.

Andy
User avatar
ronaldlees
Posts: 120
Joined: Tue May 20, 2014 5:19 pm

Re: My experiences with Visopsys install on QEMU virt disk

Post by ronaldlees »

Andy:

Now I remember why the "hd0a" partition is there. The first time I use the installer, it shows no disks or partitions. Then I click the partitioner. At that point there is only an "Empty Space" line visible in the partitioner, so I click on it and go thru the steps I've outlined, above, to create a new partition. When I get to the "format" step, Visopsys panics. It doesn't do it all the time, but it did panic when I tried to set up the disk yesterday. When I reset the virtual machine, the Visopsys installer displays the "hd0a" drive (partition) in the initial dialog, and I select it, but then I click the partitioner button and delete hd0a since it may (or may not) have been formatted. I continue and go through the procedure (outlined above) to rebuild it. Once I've done that, it's OK all the way through. When there's no panic, clicking the installer prompted buttons works just fine, and doing the procedure of this thread is unnecessary.

I suppose another way to do it would be to re-create the QEMU disk if there's a panic (probably easier). Hopefully, I'm not confusing people with this thread. OTOH, if a person doesn't know how to do one or the other (use this thread procedure or re-create the disk) - he'll go round-and-round without ever getting Visopsys installed.

A few hiccups in there still, but overall looking good Andy.

- Ron
Last edited by ronaldlees on Sun Jun 17, 2018 11:30 am, edited 2 times in total.
Post Reply