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

Sunday, September 18, 2011

ssh write failed: broken pipe

I hate when this kind of things so I surfed the net looking for an answer [1], the cause of the problem was the inactivity in the ssh session, so a keep-alive must be implemented somewhere.

It turned out in the manpages of ssh_config and sshd_config there were a couple keep alive settings:

/etc/ssh/ssh_config
ServerAliveInterval 30
TCPKeepAlive yes

/etc/ssh/sshd_config
ClientAliveInterval 30
TCPKeepAlive yes

Server/Client Alive interval are protocol-specific settings, and TCP is a connection-specific setting.

[1] https://bbs.archlinux.org/viewtopic.php?id=97003

[2] LIDSOL website

init 0 ;