Quote:
Originally Posted by dvdljns
Ok I switched this over to the xp machine. disconnected the drive that was in it and put in a 80 gig drive through on win2k, but I formatted it using ntfs and linux keeps insisting it needs to partition the hold drive. Do I need to partition this drive. should I back up and partition it 32 instead of ntfs.
|
Terminology:
Host OS - The OS (Windows XP) running VirtualBox, I.E. the real OS
Guest OS - The OS running inside a virtual machine (Linux)
Virtual Disk - A file containing data that appears as a virtual disk drive
Virtual Machine - Either the window or the settings/configuration for one virtual environment
Shared Folders - Folders on the Host OS that (can) appear as folders in the Guest OS
If you are using VirtualBox here is the way that you install Linux from a boot CD.
- Install VirtualBox software
- Create a virtual disk in VirtualBox
- Create a virtual machine in VirtualBox
- Set the virtual machine CD drive to map to your real CD drive
- Put the Linux CD in the real CD drive
- Start the virtual machine
- Install Linux inside the virtual machine
- Install the VirtualBox Guest Additions
A virtual disk consists of a file on windows XP. When you create the virtual disk you can specify where it should be stored. For example, you can store the virtual disk file on the external 80 GB drive. The format of the file system used to store the virtual disk does not matter. It can be NTFS or any other Windows XP file system. The initial contents of the virtual disk will be empty. You put things in the virtual disk from inside the virtual machine just like it was storing to a real disk drive. Anything written to the virtual drive (from inside the virtual machine) goes into the virtual disk file.
You can create an expanding virtual disk with a size limit that grows as you write more sectors. You can create a fixed-size virtual disk that allocates the entire space required and the maximum size file. You can create a read-only virtual disk and a "differences" disk to save just changes.
When you create a virtual machine, you will be asked if you want to create a virtual disk, or what existing virtual disk you want to use. You can either create the virtual disk ahead of time or during the creation of your virtual machine. If you want to create the virtual disk after creating the virtual machine then set the machine to use no virtual disk. You can always change which virtual disks are used by a virtual machine in the settings.
When you first boot a virtual machine the virtual disk is empty. The virtual BIOS will boot from the virtual CD (if available) or report an error similar to "no operating system found". Either map the virtual CD drive to a real CD drive before starting the virtual machine, or reset the virtual machine after mapping the virtual CD drive to your installation CD. You can map the virtual CD drive to an actual CD drive in the hardware or you can map it to an ISO image file. Using an ISO image file avoids having to burn a CD and tie up your real CD drive. Reading from an ISO image is also faster than reading from a real CD drive.
When the Linux CD boots inside the virtual machine it will "see" a normal PC with an empty hard disk. Tell the Linux installer to format the hard disk using ext2, ext3, reiser, or whatever you want. It will format the inside of the virtual disk file and NOT your real hard disk containing XP.
These are the usual device names seen inside a virtual machine.
/dev/hda - First (boot) hard disk (mapped to virtual disk)
/dev/hdb - Second hard disk (usually not present)
/dev/hdc - Virtual CD/DVD drive (mapped to nothing, ISO or real drive)
You can map more than two virtual disks if you want.
Install the guest additions for VirtualBox after installing Linux. That provides support for mapping real Windows XP folders, mouse pointer tracking, automatic display resizing, clipboard and seamless (combined desktop) mode.
How do you get files into the virtual hard disk? There are a number of ways, but you have to think of the virtual machine like it is a real (separate) computer from your normal Windows XP host computer running VirtualBox.
- Shared folders can be mounted to mount points
- Windows network shares can be accessed with SMB
- You can access files using NFS
- You can use FTP
- Temporarily map other virtual disks and copy files
VirtualBox guest additions provides a "vboxsf" file system driver that you can use to mount shared folders. Set the shared folders for the virtual machine settings before or during use of the virtual machine. It's one of the few things you can change while a virtual machine is running. Mount the shared folders inside the virtual machine using the normal "mount" command. You can put the mount commands in "/etc/fstab" if you like.
mount -t vboxsf sharename /mnt/mountpoint
Replace "
sharename" with the share name used in the virtual machine settings. Replace "
/mnt/mountpoint" with the mount point where you want to see the folder in Linux. Just like normal mount points you can mount shared folders anywhere in the Linux file system.
You can access Windows network shares (shared folders) in the normal way. If you're using a NAT virtual network interface, either add the computer names to "/etc/hosts" or use the IP addresses rather than the computer names. NetBIOS name service (for Windows) does not work through NAT. A bridged virtual network interface (going directly to your LAN) will allow full use of Windows file sharing including NetBIOS name service.
In case you haven't used Linux SMB there are a few ways to access files.
- Inside a GUI folder window "smb://computer/share"
- Mount an SMB share using "mount -t smbfs"
- SMB Client "smbclient" (similar to FTP) from a command shell
The "computer" name is translated to an IP address using NetBIOS over TCP/IP (non-NAT configuration), the "/etc/hosts" file, a Domain Name Server (DNS) or Windows Internet Name Service (WINS). Or you can just type the IP address in place of the computer name. The "share" name is whatever you have set on the machine sharing the folder. If it contains spaces, don't forget to use quotes around it or backslashes in front of the spaces. That normally isn't necessary in GUI folder windows.
I don't use NFS or FTP very much but they work normally in a virtual machine just like the would from a separate computer. You can access files on your "host OS" of Windows XP just as if it was a different computer from the virtual machine.
If the files you want to copy are in a virtual disk assigned to some other virtual machine you can temporarily attach the virtual disk to a different virtual machine, boot the virtual OS and copy the files like for a normal disk drive.
VirtualBox supports virtual USB devices. You can map any real USB device not otherwise in use by the OS to a virtual USB device. You have to have a Linux driver for the real USB device. That is not required to access external USB disks since you can mount them normally in Windows XP and then map folders or the entire drive to a shared folder. To do "raw" access to an external USB disk you can map it as a virtual USB device. Virtual USB devices are helpful for other kinds of devices like USB serial adapters, USB modems, USB network adapters, etc. Network adapters are also supported as virtual Ethernet ports. The main reason to use a virtual USB network adapter is for hacking/snooping in promiscuous mode.
VirtualBox also supports virtual serial ports that can be mapped to real XP serial ports or operating system pipes from Windows XP programs. I've had limited success with this feature and it doesn't seem to work as well for really high speed serial communication.
There are a number of ways to back up a virtual disk. You can simply copy the virtual disk file (when the machine is not running). You can use a normal Linux backup program from inside the virtual machine. You can temporarily mount the virtual disk on some other virtual machine that has a different OS containing the backup software you want. You can copy individual folders or files in the ways I described and store them on the host XP OS or some other computer.
There is a command line utility called "vboxmanage" that you can use to do other things for VirtualBox such as clone hard disks (assigning a unique GUID), create special kinds of disks, start virtual machines, etc. I create shortcuts for my frequently used virtual machines.
"C:\Program Files\Sun\VirtualBox\VBoxManage.exe" startvm 4fa6945c-1ee7-49cd-b869-e003ec04c3df"
The above command starts the virtual machine with the specified GUID. You can get the GUID from the virtual machine XML settings file. The GUID never changes. You can use a name instead of a GUID but you will have to change the shortcut if you ever change the machine name.
The rest of the features of VirtualBox are covered pretty well by the documentation. Look in the user forums on the web site for more information. I've found VirtualBox to be a very useful program although it isn't perfect. I recommend that you hang onto copies of versions that work well for you because newer versions tend to introduce bugs and not all versions are as good as others.
If you are going to update the VirtualBox software, back up your virtual machine XML settings files and VirtualBox settings XML file first. You don't usually need to back up your virtual disk files. If the new version of VirtualBox converts the XML files to a new format then you can still go back to the previous version using the backup XML files you saved. Always reboot the host OS after un-installing or installing VirtualBox even if it does not ask you. Some programs such as anti-virus behave badly due to the changes in network devices or drivers. In many cases you can get away without rebooting but I've run into a few problems that varied from non-functional network drivers to BSODs.
DO NOT copy virtual disk files between different kinds of operating systems. Although copying a virtual disk from Linux (for use with Windows VirtualBox) will often work, I have had problems. Do not attempt to have both Windows VirtualBox and Linux VirtualBox box share the same virtual disk files. Keep a separate copy of virtual disk files for a Linux host OS versus a Windows host OS. If you must copy a virtual disk file between types of operating systems do it only once, and not repeatedly. The problems I have encountered are most likely a bug and they don't always happen. Fixed size virtual disk images also (so far) have not been a problem.
You CAN safely copy virtual disk files to other computers providing that they use the same kind of VirtualBox host OS (Windows versus Linux). The virtual disk file format is intended to be cross-platform compatible and it mostly is with the exception of different VirtualBox host operating systems. I've done this many times and never had a problem.
Remember that you can use any of your usual boot CDs (or ISO images of them) from inside a virtual machine just like on a normal computer. To install or repair Linux and Windows inside a virtual machine, map the boot disk to the virtual CD drive and boot it. I keep a couple of ISO images handy such as a BartPE XP boot CD and Paragon Hard Disk Backup boot CD. I also have copies of my OS installation CDs as ISO images. If you're short on hard disk space you can just use normal CDs and put them in the real CD drive. Then map the virtual CD drive to the real CD drive.