Floppy support [hack]

meto

Member
Apr 6, 2010
96
0
6
Due to this topic I've done some Proxmox Perl Hacking and managed to make Floppies work in KVM. It's still a little bit dirty, but it took me 30 min to make it working so maybe implementing it as a FEATURE wouldn't be so hard.

So let's get to work. You have to edit /usr/share/perl5/PVE/QemuServer.pm as file attached. It's few small changes (look for 'floppy' in content). To ad a floppy to VM you need to have .raw image. Then edit file /etc/qemu-server/[VMID].conf and add at the end one line:
Code:
floppy0: local:101/floppy.raw
My file is floppy.raw and it's located on "local" storage in VM's 101 folder. That's all - reboot VM.

For developers - could you add "floppy" as a BUS in hard drive creation next to IDE, SCSI and VIRTIO? That's simply what I have done and it's working.

--edit
To create empty floppy RAW image:
Code:
qemu-img create floppy.raw 1440K

--edit 10.04.2010@00:50GMT
Features:
- Management via WebUI;
- Auto image creation (size 1,44MB) and no need of editing files;
- 3 formats (vmdk, raw and qcow2); // i've only tested raw so far... feedback would be nice
- Up to two floppies;

Full patch can be done by:
Code:
cd /tmp
wget http://maciek.wojcikowski.pl/proxmox/QemuServer.pm.diff
wget http://maciek.wojcikowski.pl/proxmox/hardware.htm.diff
patch -p1 -i QemuServer.pm.diff /usr/share/perl5/PVE/QemuServer.pm
patch -p1 -i hardware.htm.diff /usr/share/pve-manager/root/qemu/hardware.htm
 
Last edited:

meto

Member
Apr 6, 2010
96
0
6
Faster way to apply this:
Code:
# cd /tmp
# wget http://maciek.wojcikowski.pl/proxmox/QemuServer.pm.diff
# patch -p1 -i QemuServer.pm.diff /usr/share/perl5/PVE/QemuServer.pm
 

udo

Famous Member
Apr 22, 2009
5,918
180
83
Ahrensburg; Germany
Faster way to apply this:
Code:
# cd /tmp
# wget http://maciek.wojcikowski.pl/proxmox/QemuServer.pm.diff
# patch -p1 -i QemuServer.pm.diff /usr/share/perl5/PVE/QemuServer.pm

Hi meto,
i have applied your patch on my laptop and it's works well. I can use it for the devil-linux config without problem. So it's nice for devil-linux-vms which don't need a harddisk (e.g. router)
Thanks!

Udo
 

meto

Member
Apr 6, 2010
96
0
6
Another update - management via WebUI and auto creation. I've decided to keep instructions in initial post and keep them up to date there. To add floppy go to Hardware section of your VM, then "Add a hard disk" and choose FLOPPY bus. Correct size would be inserted. Accept at the end. Use well! ;)
 

udo

Famous Member
Apr 22, 2009
5,918
180
83
Ahrensburg; Germany
Another update - management via WebUI and auto creation. I've decided to keep instructions in initial post and keep them up to date there. To add floppy go to Hardware section of your VM, then "Add a hard disk" and choose FLOPPY bus. Correct size would be inserted. Accept at the end. Use well! ;)
Hi meto,
i have tried your update - work well after restart. But (only a disfigurement) the disksize is a little bit greater than 1,44M. Wenn i do a "qemu-img create floppy.raw 1440K" i got a file of 1474560 byte (thats right). But from the webfrontend i got a file of 1545728 byte. With 0.0013735 i got the right size.

Udo
 

meto

Member
Apr 6, 2010
96
0
6
Hi meto,
i have tried your update - work well after restart. But (only a disfigurement) the disksize is a little bit greater than 1,44M. Wenn i do a "qemu-img create floppy.raw 1440K" i got a file of 1474560 byte (thats right). But from the webfrontend i got a file of 1545728 byte. With 0.0013735 i got the right size.

Udo
I've noticed that, there is no problem to correct that, but this should not make much difference
 

meto

Member
Apr 6, 2010
96
0
6
It's possible that there is problem on kernel 2.6.18 Proxmox messes up float value (size of floppy) which doesnt enable to add image. Can anybody confirm that?
--edit
I've fixed floppy size. Still looking for errors.
--edit2
The problem was probably caused by value provided by udo and mine previous one, which was rounded (in Proxmox way od founting). 1,44MB which is 1474560 bytes proxmox understands as 0,001373291015625 GB (1474560 / 1024 / 1024 / 1024).
--edit3
Since the size is finally correct, the size input was made read-only.
 
Last edited:

dietmar

Proxmox Staff Member
Staff member
Apr 28, 2005
17,078
490
103
Austria
www.proxmox.com
BTW, is it possible to put a floppy onto an LVM storage? I guess not, because of size restrictions?
 

meto

Member
Apr 6, 2010
96
0
6
You can't create an image with size 1440K on LVM (size is a multiple of 4MB). I thought that can make problems?
Maybe it created LV that has size 1,44MB, but either way took one block size - 4MB as you say. I didn't check that, but I manage to format and write to the floppy.
 

tstav

New Member
Jun 21, 2010
9
0
1
I tried it but I got errors during patch 1 to QemuServer.pm
==============================================
cnet-vm1:/tmp# patch -p1 -i QemuServer.pm.diff /usr/share/perl5/PVE/QemuServer.pm
missing header for context diff at line 3 of patch
patching file /usr/share/perl5/PVE/QemuServer.pm
Hunk #1 FAILED at 167.
Hunk #2 succeeded at 191 with fuzz 2 (offset 4 lines).
Hunk #3 FAILED at 249.
Hunk #4 FAILED at 306.
3 out of 4 hunks FAILED -- saving rejects to file /usr/share/perl5/PVE/QemuServer.pm.rej
========================================================================

I am using the latest proxmox kernel 32
 

user100

Member
Sep 15, 2008
35
0
6
For one time floppy support (to install some drivers) it's even possible without hack with following steps:

*) Create and start the machine as usual via Webinterface.
*) Search for the kvm process: 'ps ax --width 800 | grep kvm' - and copy the line from that machine beginning from "/usr/bin/kvm".
*) Stop the VM via Webinterface
*) Login to the Proxmox-Server via shell (SSH) and paste the previous copied kvm line and add the floppy option at the end (for example '-fda /var/lib/vz/template/iso/virtio-win-1.1.11-0.vfd'). Hit enter to start the VM.
*) Use the machine in the Webinterface normal way (VNC). After you power off the machine the floppy-drive is gone away.


Greetings,
user100
 

nt_support

New Member
Mar 29, 2011
9
0
1
Norfolk Island
Thanks user100 (& meto),

Used your trick to install Win2K3 with virtio drivers for the disk from the start. Best & simplest method I found so far.

If anyone is wondering the drivers are here : http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/

You can put the ISO image into your normal ISO store with proxmox, which you can then use to update network, etc, but proxmox doesn't like the vfd file. Just scp it onto your server somewhere that you can access it (I used the ISO dir anyway) & process as above.

One thing I noted was that once I loaded the "floppy" the system didn't boot correctly, just use the ctrl-alt-del function in vnc then F12 to select a boot option, then choose the CD (ISO).
Proceed as normal.

Cheers
nts
 

nt_support

New Member
Mar 29, 2011
9
0
1
Norfolk Island
Hi Udo,

I did note that & the default sequence is HDD, Floppy, CD, ... , but since this is a VM this sequence seems logical to me & you only use the floppy this once so it's just as easy to press F12 & select the CD.
cheers
nts
 

bert64

Member
Aug 14, 2008
71
0
6
Add my vote for floppy support, win2k3/xp is somewhat of a pain to install on virtio disks without floppy support (2k8/vista/7 lets you load drivers from cd)....

Perhaps it would be possible to distribute the fedora virtio floppy images as an installable package and add them by default when creating a windows vm?
 

mingr

New Member
Oct 13, 2011
1
0
1
Additional way to the floppy support - just add add "args:" to the /etc/qemu-server/xxx.conf file:

args: -fda /your/location/for/floppy.vfd
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!