Using Windows XP in VirtualBox on Linux
As a person who uses Linux regularly, often I am asked about my opinions about other operating systems, especially those coming from large companies located in Redmond, Washington. Here's the deal. Operating systems are tools. We use them to do jobs. It is always a good idea to think critically about what tools you are using, and verify if other tools can do the same job in a more efficient or flexible manner.
Having said that, using Linux as a Host OS for VirtualBox, I will show you how to create a Windows virtual machine that can interact with shared network folders in a Windows network as if it were an actual machine instead of a virtual one. In this article, I will also show you how to mount local Linux directories as network drives within your Windows Guest OS.
I'll start by assuming that you already have VirtualBox installed (available here).
This tip assumes that you have legitimate installation media for Windows XP. Start by selecting "New" to create a new virtual machine.
Indicate the Virtual Appliance name, and select the type of Operating System. In this case, it will be Windows XP.
Select the amount of RAM that you want the virtual machine to use. I chose 1024 megabytes, as my system machine has 4GB of RAM.
Choose an exisiting virtual hard disk, or create a new one. I will assume that you wish to create a new virtual disk image (VDI).
Choose either a dynamically expanding or fixed size virtual disk. I'm a fan of dynamically expanding storage, as it takes up less room on your hard drive if the virtual hard disk is not full.
Choose the size of your hard disk. In VirtualBox, expanding the size of virtual disk is a relatively time-consuming endeavor, so give yourself some breathing room here.
Verify your hard disk choices and choose "Finish".
Verify the rest of your choices, and click "Finish" again,
Your Guest OS should now be in your VirtualBox menu. Before installing, we need to change some of settings, so highlight your virtual machine and click on "Settings".
If you wish to install XP from an actual disk, the you need to enable the drive through the host OS. Under "Storage", select the CD icon under IDE controller, and select "Host Drive" under "CD/DVD Device".
Insert the OS disk, start the virtual machine, and install Windows XP as if it were a normal machine.
After installing the OS, I would recommend installing Guest Additions to your Windows XP machine. There is an entire chapter of the VirtualBox Manual dedicated to Guest Additions, and I encourage you to read it, but here is the manual's description of what Guest Additions can do.
The Guest Additions offer the following features:
- Mouse pointer integration - To overcome the limitations for mouse support that were described in the section called "Capturing and releasing keyboard and mouse", this provides you with seamless mouse support. You will only have one mouse pointer and pressing the Host key is no longer required to "free" the mouse from being captured by the guest OS. To make this work, a special mouse driver is installed in the guest that communicates with the "real" mouse driver on your host and moves the guest mouse pointer accordingly.
Better video support - While the virtual graphics card which VirtualBox emulates for any guest operating system provides all the basic features, the custom video drivers that are installed with the Guest Additions provide you with extra high and non-standard video modes as well as accelerated video performance.
In addition, with Windows and recent Linux, Solaris and OpenSolaris guests, if the Guest Additions are installed, you can resize the virtual machine's window, and the video resolution in the guest will be automatically adjusted (as if you had manually entered an arbitrary resolution in the guest's display settings).
For Linux and Solaris guests, the Xorg server version 1.3 or later is required for automatic resizing (the feature has been disabled on Fedora 9 guests due to a bug in the X server they supply). The server version can be checked with Xorg -version.
Finally, if the Guest Additions are installed, 3D graphics for guest applications can be accelerated; see the section called "Hardware 3D acceleration (OpenGL and Direct3D 8/9)".
- Time synchronization - With the Guest Additions installed, VirtualBox can ensure that the guest's system time is better synchronized. This fixes the problem that an operating system normally expects to have 100% of a computer's time for itself without interference, which is no longer the case when your VM runs together with your host operating system and possibly other applications on your host. As a result, your guest operating system's timing will soon be off significantly. The Guest Additions will re-synchronize the time regularly. See the section called "Tuning the guest time synchronization parameters" for how to configure the parameters of the time synchronization mechanism.
- Shared folders - These provide an easy way to exchange files between the host and the guest. Much like ordinary Windows network shares, you can tell VirtualBox to treat a certain host directory as a shared folder, and VirtualBox will make it available to the guest operating system as a network share. For details, please refer to the section called "Folder sharing".
- Seamless windows - With this feature, the individual windows that are displayed on the desktop of the virtual machine can be mapped on the host's desktop, as if the underlying application was actually running on the host. See the section called "Seamless windows" for details.
- Shared clipboard - With the Guest Additions installed, the clipboard of the guest operating system can optionally be shared with your host operating system; see the section called "General settings".
- Automated Windows logons - (Credentials passing; Windows guests only) For details, please see the section called "Automated Windows guest logons".
OK, Now you should be convinced that installing Guest Additions is a good idea. Luckily, installing Guest Additions is easy! While your virtual machine is running, click the "Devices" menu and select "Install Guest Additions."
A setup wizard should begin shortly. Choose to continue.
Twice during the install, Windows will freak out and warn you that the drivers that are being installed haven't passed "Windows Logo testing". It's OK. Choose to "Continue Anyway".
Windows will ask you to reboot your (virtual) machine. Do it.
Congratulations. VirtualBox Guest Additions have now been installed.
Now that Guest Additions have been installed, let's take advantage of the feature that allows you to mount a Linux directory as a network share. Select your Virtual Machine from the menu, and select "Settings"
Under "Shared Folders", click the
Add Shared Folder icon on the right side of the window.
Under "Folder Path", select "Other".
Browse to the directory that you wish to share, and select "Open".
Verify your selection, choose the name of the shared folder, choose whether or not to have "read-only" access, and click "OK".
Start your virtual machine, click the start menu, right click "My Computer" and select "Map Network Drive".
Choose the drive letter of your network drive, and click "Browse" to find your directory.
Your share should be listed under:
Entire Network ----VirtualBox Shared Folders --------\\Vboxsvr ------------\\VBOXSVR\YOUR_SHARE_NAME_HERE
Select "OK", then select "Finish"
Marvel at your new "Network Drive" shared folder. This is one way to get around resizing your virtual machine if you are running out of virtual hard drive space.
If you wish that your Guest OS can access and share files on your Windows file sharing network, you will need to change the way that your virtual machine interacts with the Internet. Under "Settings"/"Network", change "NAT" to "Bridged Adapter".
Please understand, the choice to use Bridged Networking does have security repercussions. The VirtualBox Manual explains the benefits and limitations of the different networking modes that are available, but this statement from the VirtualBox manual sums it up rather well:
In bridged networking mode, all traffic goes through a physical interface of the host system. It is therefore possible to attach a packet sniffer (such as Wireshark) to the host interface and log all traffic that goes over it. If, for any reason, you prefer two or more VMs on the same machine to communicate privately, hiding their data from both the host system and the user, bridged networking therefore is not an option.
I will assume that you are willing to accept the security risks that go with using this networking mode, as well as the additional risks of allowing file sharing within Windows.
Choose the directory that you wish to share, right-click it, and select "Sharing and Security"
You may have to complete the Network setup wizard to enable File and Printer Sharing.
Check "Share this folder on the network", the click "OK". It may ask you to reboot your (virtual) machine again.
When you restart the computer, you will notice that your directory is listed as a shared directory, and it will be accessible as a Samba share on your Linux host machine, as well as all other machines on your network. Enjoy!
Linux rocks! Personal blog: zootlinux.blogspot.com
|Designing Electronics with Linux||May 22, 2013|
|Dynamic DNS—an Object Lesson in Problem Solving||May 21, 2013|
|Using Salt Stack and Vagrant for Drupal Development||May 20, 2013|
|Making Linux and Android Get Along (It's Not as Hard as It Sounds)||May 16, 2013|
|Drupal Is a Framework: Why Everyone Needs to Understand This||May 15, 2013|
|Home, My Backup Data Center||May 13, 2013|
- Linux Systems Administrator
- New Products
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Designing Electronics with Linux
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Have you tried Boxen? It's a
3 hours 32 min ago
- seo services in india
8 hours 4 min ago
- For KDE install kio-mtp
8 hours 5 min ago
- Evernote is much more...
10 hours 5 min ago
- Reply to comment | Linux Journal
18 hours 50 min ago
- Dynamic DNS
19 hours 24 min ago
- Reply to comment | Linux Journal
20 hours 23 min ago
- Reply to comment | Linux Journal
21 hours 13 min ago
- Not free anymore
1 day 1 hour ago
1 day 5 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi
It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?