Tuesday, September 27, 2011

Sep 27th 2011 - Transfer data between virtual machine and host without network

Today I needed to transfer data between a virtual machine and the host.

The main problem was the lack of networking support in MINIX v3.1.0 (the virtual machine) so I could not scp or ftp anything between the systems.

I came to rescue the day with the idea of a special sneakernet between the virtual machine and the host.

On the host

  • Create the floppy image on the host.

    % dd if=/dev/zero of=floppy.img bs=1024 count=1440

  • Attach the floppy image to the virtual machine.

    The process depends on the virtualization software so is left as exercise to the reader.

On the virtual machine

  • cd to the data (let's call it payload, shall we?.

    $ cd /home/tonejito/payload

  • tar the relevant files into the floppy device (/dev/fd0)

    $ tar cvvf /dev/fd0 file file file ...

On the host

  • Detach the floppy image from the virtual machine

    Another exercise left to the reader

  • Extract the files
    % tar xvvf floppy.img

  • List the contents

    % ls
    floppy.img file file file

That's all

No comments:

Post a Comment