info-mtools
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Info-mtools] use windows 95 with the kvm virtualization in linux


From: Alain Knaff
Subject: Re: [Info-mtools] use windows 95 with the kvm virtualization in linux
Date: Wed, 28 Apr 2010 00:47:49 +0200
User-agent: Thunderbird 2.0.0.24 (X11/20100317)

<address@hidden> wrote:
> Hi
> 
> I am using the actual Debian Linux and wish to use windows 95 in the kvm
> virtualization in linux
> 
> I wish to install the virtual drive C: so, that I can process the file
> into C: from Linux using mtools (mcopy, mdir, mdel and mcd).
> 
> a c.img with 500 MB (or only 250 MB) would be more than enough as the
> disk at the time from windows 95 were not bigger. my kvm files are
> placed in ~/kvm/ .
> 
> what is to do to create, active,

If I understand you right, you are looking for a way to access a Qemu (or Kvm)
guest OS's disk image from the host?

There are to ways to achieve this goal:


1. If your qemu image is set up as raw:

Raw images are created as follows:

 qemu-img create -f raw ~/kvm/c.img

In that case, you may access it directly, using for instance
 mdir -i ~/kvm/c.img@@offset ::
 mcopy -i ~/kvm/c.img@@offset myfile.txt ::
 mcopy -i ~/kvm/c.img@@offset ::myfile.txt .

where raw.img is the name of the image file, and offset is the offset into the
image file. Offsets may as bytes (32256), sectors (63S), kilobytes, megabytes
or gigabytes.

In general, the first partition starts after one track (63 sectors in most 
cases):

 mdir -i ~/kvm/c.img@@63S ::

N.B. You need a 4.x version of mtools to get support for offset


2. If your qemu image is set up as qcow2:

Qcow2 images are created as follows:

 qemu-img create -f qcow2 ~/kvm/c.img

Then, they may be accessed from the host as follows:

 a. Start up the server:
      qemu-nbd -P 1 ~/kvm/c.img
    This makes available the first parition (-P 1) of the device image stored
    in qcow.img. This commands is the server, and should not be interrupted.
    Start the other commands in a different window.
 b. Load the nbd kernel module
      modprobe nbd
 c. Start up the client (binds device made available by the server to a block
    device):
      nbd-client localhost 1024 /dev/nbd0
 d. If needed, make the nbd device accessible to all users:
      chmod 666 /dev/nbd0
    (or chmod 444 /dev/nbd0 for read-only access)
 d. Access it using mtools:
      mdir -i /dev/nbd0 ::
      mcopy -i /dev/nbd0 myfile.txt ::
      mcopy -i /dev/nbd0 ::myfile.txt .


> format an adequate ~/kvm/c.img or where

Although creating the image must be done on the host (using qemu-img create 
...), the
partitioning and formatting is best done from within the guest OS (i.e. Windows 
95)
while it is being installed.

> may I find a tutorial about this job?

You may find some info about this on 
http://tjworld.net/wiki/Linux/MountQemuQcowImages

They also supply a "simpler" command to do the various nbd steps in one go:

  qemu-nbd -P 1 -c /dev/nbd0 ~/kvm/c.img

... but I've found that this doesn't work well with partitions (-P 1). If I try 
to
use that command with partitions, it hangs on my Kubuntu 9.04.

It does work tough without -P 1, but then you need to figure out the offset 
yourself,
and give it to mtools (@@63S).

> 
> what can destroy the created file system during the installation from
> Windows 95?

Of course, you need to be careful when accessing the qemu device in such way. 
For
example attempting to write to the raw image after using a bad offset may 
destroy
the data. No risk with just reading (mdir). So I'd suggest you first do some 
tests
with mdir until you have found the right offset.

Also, be careful about accessing devices both from the guest VM and the host at 
the
same time (better stop the VM when accessing the image from the host).

If simultaneous access from the Windows 95 guest and the host is desired, you 
might
want to set up a samba share on the host instead.

> 
> kind regards
> 
> notes:
> 
> used software:
> - 622C.img or msdos710.img or freedos (if I find again the image of the
> short installation FD!) or Windows95b.img to start dos and the installation
> - original MS CD's of windows 65 early version  4.00.950 or  4.00.950A,
> newer version with or without USB connectivity B or C
> - Linux file system: ext3
> 


Hope this helps,

Alain




reply via email to

[Prev in Thread] Current Thread [Next in Thread]