PDA

View Full Version : Knoppix 6.4.3 Persistent Data under VirtualBox on Windows 7



Forester
01-29-2011, 03:30 PM
Hi, I am running Knoppix 6.4.3 installed to USB as a guest OS in VirtualBox on Windows 7. Knoppix itself runs fine but I can't get the persistent data bit working. I've tried a several approaches over the last week but each has hit a road block and I am beginning to wonder if I am trying to do Something Entirely Unreasonable.

Confirmation of this or suggestions to the contrary would be much appreciated.

I have a collection of Knoppix CDs going back over 5-6 years. I have used them mainly as rescue disks but also as demos to sceptics unable to believe that Linux could run on their PC. A while back I had a USB stick with a 2 Kb sector size (I could not boot it into Linux at all) on which I put a Knoppix 6.0.1 ISO image and qemu-0.9.1-windows. I was able to demonstrate Knoppix running under Windows XP and I have a knoppix.img file that I think proves the persistent data bit was working.

Two years later I have just met Windows 7 and my first thought was Help ! Where's my Knoppix ?. I know as much about Windows and most PC users do about Linux so I guess I'm not a PC.

I have a 16 GB USB stick with two partitions: a 8 GB vfat and an 8 GB ext3 partition. I have installed Knoppix on the vfat partition from the Live CD using the menu option provided. I also have a copy of the Live CD ISO file on the vfat partition. The USB installation boots fine on several PCs and the persistent data bit appears to work. I can boot the USB installation at work but it would be more than my job's worth. So ...

Plan A: Create a VirtualBox VM with the USB stick as a 'rawdisk' and boot the USB installation. It boots, asks about creating a persistent data image but fails to create one, continues to boot. Knoppix is fine. It seems the boot can't create the persistent data image because the 'rawdisk' is read-only. I have found something on a VirtualBox site claiming this is a Windows thing that came in with Vista. Vista, apparently, included lots of measures to stop Windows users self-harming.

I found that the 'rawdisk' is read-only only when it is the boot device.

So ... Plan B: Create a VirtualBox VM with a CD device pointing to the ISO file on the USB stick and boot Knoppix from the ISO file instead of the 'rawdisk'. The idea was to tell the boot to put the persistent image on the 'rawdisk' (aka my USB stick). It seems that when the boot detects a boot from CD, it does not offer you the option to create a persistent image. This behaviour appears to be 'new' but I can't find any documentation that says clearly you can or you can't use a persistent image with Knoppix 6.4.3 booted from CD.

I've looked at the Knoppix cheat codes that come with 6.4.3 with the idea that I might be able to tell Knoppix to use a persistent data image and where to find it. The only cheat code that looks like it might be relevant is home= but I have been unable to get that to work. What is the home cheat code supposed to do ?

I've have tried to install to USB from within the guest Knoppix (this would give a persistent data image inside a virtual disk, which is not ideal). I've tried with the virtual disk formatted with and without (super-floppy) partition table. In both cases syslinux was unhappy and the install aborted.

I've tried my old Knoppix 6.0.1 with qemu-0.9.1-windows but the latter is rather old and Windows 7 really does not like it. I don' t see any reason why using qemu instead of VirtualBox would help anyway.

So ... unless someone out there has any other suggestions, it seems the options left are to revert to an older version of Knoppix where I can use persistent data with a boot from ISO image or to give up on the portability and just install Debian as guest OS. :(

Werner P. Schulz
01-29-2011, 06:00 PM
... you can find the answer to your questions on my side.

Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
"Build personal Recovery-CD with Knoppix (Knoppix remaster)"

Forester
01-31-2011, 08:57 PM
Thank you Werner for your suggestion I might find the answer on your site. I am puzzled.

I had read your site before I posted my question. I have read it again. I have waited till Monday so I could read it again at work with the Windows 7 in front of me. Which part of your summary contains the answer I seek ?

Is it the multi-boot description ? My USB is already formatted with a second partition.

Is it the creation of a vdmk 'rawdisk' under Virtual Box ? That was Plan A and it does not work.

That leaves remastering but you do not suggest what I need to change in my remastered Knoppix image.

Plan A does not work: if I boot Knoppix from the USB, Knoppix fails to create knoppix-data.img because the USB is read-only. This is a Windows thing: http://forums.virtualbox.org/viewtopic.php?t=6002.

Plan B does not work: with Knoppix 6 the home= cheatcode exists only in the documentation. See http://www.knoppix.net/forum/threads/28894-persistence-to-HD-when-booting-from-DVD. I have examined /init and agree with kl522.

It seems that running Knoppix under Windows and saving persistent data was an Entirely Reasonable Thing to do with Knoppix 5 and Windows XP but is an Entirely Unreasonable Thing to want to do with Knoppix 6 and Windows Vista or later.

The more I look round the forums the more threads I find with folk asking if there is anyway to put the persistent image on another device but all seem to have been met with incomprehension.

I may well have remastered my Knoppix eventually, if only to upgrade from Gallieo to Helios. However, the attraction of Knoppix is that it works 'out-of-the-box' and you only move on to remastering when and if you are good and ready. I am sure that it is not all that hard but having to learn how to remaster and then remastering in order to make Knoppix useful is another Entirely Unreasonable Thing. It certainly won't impress the sceptics, including my boss.

It looks to me like I would need to alter the /init script. I can do that but I'd rather not if the home=cheatcode was removed for technical and/or security reasons rather than for timescale and/or does-anyone-really-need-this reasons.

The /init script is in minirt, which is in plain sight on the USB stick so technically I do not need to remaster at all. Am I right ?

The good news today is I managed to 'install to USB' onto a small vdi virtual disk. So I could run Knoppix from the iso image and modify the minirt on the virtual USB stick and reboot from the virtual USB stick for testing purposes. Knoppix has fakeroot so I should be able to unpack and repack minirt safely.

Have I missed anything ? Is there an easier way ?

klaus2008
01-31-2011, 11:21 PM
I use Oracle VirtualBox 3.2.12 on a Windows 7 Pro host. I installed Knoppix 6.2.1 on a 2 GB CF card using the flash install utility. I do the following in order to boot Knoppix 6.2.1 from that CF card into a virtual machine.

My first step is to connect a Knoppix 6.2.1 CD iso image to the virtual machine. There is virtual hard disk connected to the virtual machine with a 2 GB swap partition.

I insert the CF card into the USB card reader so that Windows recongnises it. Then I boot the virtual machine. As soon as the splash screen appears I quickly press a key in order to stop the bootloader's timeout. I connect my USB card reader to the virtual machine. Windows does not see the card reader anymore. I enter the line
knoppix fromhd=/dev/sdb1 at the splash screen's boot prompt. Knoppix 6.2.1 boots and searches for the USB devices. It finds my flash install on the CF card and uses the persistent image in the KNOPPIX directory.

Booting Knoppix this way has the advantage that I could install the VirtualBox guest additions. Now I can use a shared folder on my Windows host. The main disadvantage I see is that I need some disk space for the iso image.

My first idea was to install the PLoP Bootmanager on the virtual hard disk as it is possible if you use VMware Player. The PLoP Bootmanager adds the ability to boot from a USB device. But with Oracle VirtualBox 3.2.12 I had no success.

Forester
02-01-2011, 09:41 PM
Yes, brilliant. Many thanks Klaus ! :D

I was using VirtualBox incorrectly. Doh ! Rather than access the USB stick as a 'rawdisk', I should access it through the USB pass-through controller. While I've used 'rawdisk' to run (the original) Windows under kvm/qemu Linux on a dual boot machine, I've never really used Virtual Box and I have never used a USB pass-through before.

I'm using VirtualBox 4.0.1 without the PUEL extensions on Windows 7 Enterprise. I think. My experience is slightly different.

After navigating in VirtualBox to the screen where you can enable the USB controller for the Virtual Machine, I clicked on the upper of the two icons and was presented with a list of USB devices present on the machine. I selected the 'unknown' one (on the basis the others were clearly not USB sticks). This added an entry that is specific to my USB stick. On starting the Virtual Machine, the USB stick 'disappears' from Windows, as you say, but it does it automagically. It reappears in Windows automagically when I shut down the Virtual Machine. No need to 'connect' as you describe.

When I boot as directed, Knoppix reads knoppix-data.img from the USB stick and saves it back again on shutdown. Excellent result.

Yesterday I managed to install 'Knoppix to USB' onto a virtual disk. I can boot this disk. It should be easy enough to change syslinux.cfg on this disk to that the fromhd=/dev/sdb1 is automatic. This also means I don't need a copy of the Knoppix ISO file on the Windows disc but I don't save any disk space because the ISO file has effectively been copied to the virtual USB stick.

It should be possible to create a bootable virtual disk of 10 Mb or less that contains just enough to redirect the boot to /dev/sdb1. This saves the disk space and will be small enough to backup on the real USB stick so providing portable solution. Superlative. :cool:

Werner P. Schulz
02-02-2011, 11:01 AM
Plan A: Create a VirtualBox VM with the USB stick as a 'rawdisk' and boot the USB installation. It boots, asks about creating a persistent data image but fails to create one, continues to boot. Knoppix is fine. It seems the boot can't create the persistent data image because the 'rawdisk' is read-only.... excuse my late answer.

At this point "asks about creating a persistent data image" Knoppix doesn't wait very long; the boot process goes on and it seems as there is no ability to create persistent memory. Reboot and try once more.

If you create the Virtualbox rawdisk as I describe on "summary.html", the rawdisk is read- and writeable.

Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
"Build personal Recovery-CD with Knoppix (Knoppix remaster)"

Forester
02-03-2011, 01:22 AM
Werner,

I will write for the third and last time: It does not work under Windows 7.


If you create the Virtualbox rawdisk as I describe on "summary.html", the rawdisk is read- and writeable.
The example you give is for Linux. I'm sure it works for Linux as am I sure it works for Windows XP but I have Windows 7.

Knoppix thinks the device is read/write. So does Virtual Box. However, Windows 7 blocks any attempt to write to the device. It's a security thing. I don't know the details and I don't want to. In simple terms, if you try to write to a raw boot device, Windows 7 thinks you are trying to slip some malware into it's underware and blocks you.


At this point "asks about creating a persistent data image" Knoppix doesn't wait very long; the boot process goes on and it seems as there is no ability to create persistent memory. Reboot and try once more.My apologises. To clarify ... Knoppix tries and fails to create the persistent data image. It reports errors writing to the device. Once Knoppix has booted, I can mount the second partition on the USB stick. It is mounted read/write as far a Knoppix is concerned but if I try to create a file on the partition, Knoppix reports the partition is read-only.

I rebooted the physical PC from the USB stick and Knoppix was able to create a persistent data image, so the issue is not a dodgy USB stick. I reboot in the virtual PC and Knoppix read the persistent data image OK and I could see the changes I had made. However, when I tried to shut the virtual machine down Knoppix could not write back new changes to the persistent store and hung. I had to kill off the Virtual Machine ungracefully.

Klopt oder ?

Forester
02-03-2011, 01:30 AM
Can this thread be marked [Solved] please ?

For a solution to the original question see http://www.knoppix.net/forum/threads/29029-Miniboot-Disk-for-Knoppix-with-Persistent-Data-as-a-Virtual-Machine-Guest-OS.