VirtualBox - Chapter 6

From FreeDOS
Jump to: navigation, search

Chapter 1: Prepare a virtual machine for FreeDOS in VirtualBox

Chapter 2: Special settings for FreeDOS

Chapter 3: Connect the FreeDOS install CD

Chapter 4: Install FreeDOS

Chapter 5: Install the network

Chapter 6: Mount the FreeDOS image to transfer files

Chapter 7: FTP between host and guest


Bugs: High CPU usage of FreeDOS machine

Bugs: FreeDOS crashes at boot

Bugs: ICH9 chipset breaks networking

Bugs: Old bugs


Mounting a VHD image on the host

If you like to exchange files between guest and host, mounting the guest image is an easy way to do it. You just open the FreeDOS disk image in VHD format in your host and drag’n drop files with Windows Explorer, Macs Finder or Gnomes Nautilus.

Take care: Don't mount an image while it is still running in VirtualBox. And for the worst case: Make sure you have backups.

(I wrote this HowTo for FreeDOS 1.1. But it works the same with FreeDOS 1.2.)


First thing you have to do: Shut down the FreeDOS guest.

Vhd-03-virtualbox-machine-powered-off.png


Then find the FreeDOS image file, f.i. by hovering the mouse over the name in the “Storage” section of VirtualBox.

Vhd-02-virtualbox-show-location.png


Now mount the image in Windows, Linux or on the Mac.



Windows

Windows 7 and later is able to connect VHD images. If your FreeDOS image is in VDI instead, you can convert it to VHD.

To connect the VHD image, click into the search bar.


Vhd-04-windows-search.png


Enter “Computer Management”.


Vhd-05-windows-computer-management-search.png


Click “Disk Management”, wait until it’s started and right click “Disk Management” again. Choose “Attach VHD”.


Vhd-06-windows-attach-vhd.png


Choose the location of your FreeDOS VHD image file.


Vhd-07-windows-browse-vhd.png


You can see that the FreeDOS harddisk has been attached to Windows.


Vhd-08-windows-vhd-attached.png


Now you can open it in Windows Explorer like any other disk.


Vhd-09-windows-vhd-in-explorer.png


By default Windows is hiding system files, so you can’t see AUTOEXEC.BAT and others. To take care of that, click “Options”.


Vhd-10-windows-explorer-options.png


and uncheck “Hide protected operating system files”.


Vhd-11-windows-explorer-unhide-files.png


Now you can see all FreeDOS files in Windows Explorer.


Vhd-12-windows-explorer-shows-files.png


Windows will add directories and files like $RECYCLE.BIN and System Volume Information to that disk. All methods to prevent that didn’t really work out. So I’d recommend to just ignore those creations, when you are in FreeDOS.

If you are done, please take care to eject the image before you startup the FreeDOS guest in VirtualBox.


Vhd-13-windows-explorer-eject.png



Mac

Mounting the volume is much easier on the Mac.

Get the program “Paragon VMDK Mounter” (free after registration). It can mount various image files like VDI or VHD. Find the image file you like to mount.

Vhd-16-mac-mount-vhd.png

Double-click it. The FreeDOS volume is mounted and you can access it with the Finder.

Vhd-18-mac-vdi-mounted.png

macOS will add files and folders like .DS_Store or .Trash automatically to that volume. If you want to keep the FreeDOS image free from those creations, you can install the app “Blue Harvest” from the AppStore.

Please take care to eject the volume before starting the FreeDOS guest in VirtualBox.



GNU/Linux: Ubuntu 16.04 LTS

This section explains mounting a VHD image in Ubuntu 16.04 LTS. Please take care and do a backup first. Never mount a VHD while the virtual machine is running in VirtualBox.

You need to have libguestfs-tools installed.

sudo apt-get install libguestfs-tools

I assume the VHD-file is named FreeDOS_1.2.vhd.

It is mounted with user-rights, so the mount point should be in the home-directory. I assume /home/username/vhd.

Now all you have to do, is to mount it with guestmount.

guestmount -a FreeDOS_1.2.vhd -m /dev/sda1 /home/username/vhd


VirtualBox-MountVHD-Ubuntu.png


Now you can see and access the files on your FreeDOS disk image directly from your host computer.

Use the --ro option to mount the VHD read only. With the command above, my image was writable but all files where owned by root anyway.

If you are not sure about the /dev/sda1 part, you can first use virt-filesystems to show you the partitions and filesystems on the virtual disk image:

virt-filesystems --long --filesystems -a FreeDOS_1.2.vhd

Don't forget to unmount the VHD file again before you start your FreeDOS guest in VirtualBox.

guestunmount /home/username/vhd



Continue with Chapter 7