Showing posts with label virtualbox. Show all posts
Showing posts with label virtualbox. Show all posts

Tuesday, November 13, 2012

Resizing a VirtualBox hard drive image under Windows

Every once in a while I run out of hard drive space on one of my virtual machines. I used to go through wild gyrations to add an additional hard drive to the machine. It's actually much simpler to just expand the hard drive.

In my case, I'm using a Windows 7 guest OS inside a Windows 7 host OS. I do the following:

  1. Shutdown the guest machine
  2. Start a command prompt and type the following:
    1. "c:\Program Files\Oracle\VirtualBox"\vboxmanage modifyhd Win7CppDev.vdi --resize 30720
  3. You should be able to confirm that the drive is larger in File > Media Manager.
  4. Boot the guest VM
  5. Start Computer Management > Storage > Disk Management
  6. Use "Extend Volume..." on C: partition to use the newly unallocated partition space.
  7. Restart guest OS for good measure, even though I don't think it is needed.
Congratulations, you now have more space.

Thursday, July 12, 2012

Using Dell Smart Card Reader in VirtualBox guest via RDP

I've had a bunch of issues getting my VirtualBox guest machine to use the built-in Dell Latitude E6520 smart card reader. It seems to be a known issue with VBox, but basically the internal guest OS just doesn't see the device, or if it does, it can't use it. I've been working around the problem by purchasing an external USB smart card reader (SCM Microsystems SCR3310) to read my CAC.

My setup is as follows:

  • Host: Dell Latitude 6520 laptop running Windows 7 64-bit, 8GB RAM, dual-core/dual-thread Core i5 to provide 4 virtual processors. Using latest copy of VirtualBox.
  • Guest: Windows 2008 R2 Server, 4GB RAM, 3 processors.

I found a new trick that works. Instead of using the graphical console that VirtualBox gives me, I boot the VM into headless most (using command line), then use Remote Desktop Protocol to connect directly to the virtual machine. Note that I'm using the RDP service provided by Windows Server, NOT the RDP service provided by VirtualBox. That is, I RDP into the virtual machine and NOT to the RDP service offered on the host laptop that VBox intercepts. My exact steps were as follows.

  • Configure the VM with a Bridged network adapter so it gets a similar address on your local network as your laptop. This could also probably be done by adding a "local only" network adapter. I don't think it will work properly with a NAT network. (I run both a NAT and a Bridged at the same time sometimes)
  • Boot the Windows Server VM. Do NOT enable "Remote Display" in the display settings. You can either use the command line "VBoxHeadless -startvm my_vm" command, or just start it from the GUI and ignore the console.
  • Make sure RDP is enabled in your Windows Server. Use the Server Manager and/or initial configuration wizard to do it, or just go through the control panel.
  • Use CMD.exe with 'ipconfig' to make note of your IP address on the bridged network. (Example: 192.168.40.2)
  • From the host laptop, start an RDP session
    • Use host: 192.168.40.2 (or whatever the bridged address was)
    • On the Local Resources tab, use "More..." and turn on "Smart Cards" check box
When it connects, you should now have access to your Smart Card. Additionally, it will detect the insert/remove events if you re-insert it (another thing that it doesn't do, even when I have my external smart card reader attached).

NOTE: In my case, I also had ActivClient installed on my Windows Server VM so that I could manipulate the smart card. I'm not sure if you need that or not.

Sunday, December 11, 2011

Custom resolution for Ubuntu VM running in VirtualBox on Linux

So, I've got a Ubuntu server linux box where I run VirtualBox VM's, including an Ubuntu Desktop machine that I remotely display on my Windows box. (Yeah, I know, confusing and overly complicated.) Anyway, when running Gnome on the Ubuntu desktop, the maximum resolution it would give me was 1360x768. Since I have a 1920x1200 monitor on my Windows machine where I run my X server, I wanted a bigger Ubuntu desktop.

The most useful post I found was this: http://www.ubuntugeek.com/how-change-display-resolution-settings-using-xrandr.html

I ran the following commands:

  1. cvt 1680 1050 -- get a X modeline similar to "1680x1050_60.00" 146.25.... (more numbers)
  2. xrandr --newmode {output of the previous modeline}
  3. xrandr --addmode VBOX1 1680x1050_60.00 (causes the X display to flash)
  4. Use System > Preferences > Monitors to pick my new resolution
Voila. Easy, peasy. Works great now.


Friday, October 22, 2010

Creating a VirtualBox VM from a VMware machine

I recently had some problems where my VMplayer was running really slow for an XP guest machine on my Vista host machine. The performance was terrible -- very very unusably slow. It took 10 minutes to boot and then would have a 2-3 second lag (at least) when moving mouse and clicking on something. I have no idea why, so I thought I'd try some other options.

I decided to try Virtual Box, the free VM player from Oracle/Sun. So far, it work pretty well.

I was able to use the existing VMware disk image for my Vbox image. I copied the VMware .vmdx files from my existing directory into a new place, then created a new Vbox image and pointed it to the existing disk image. It was VERY straight forward.

The one problem I had was networking and display drivers. When I boot the machine, it didn't want to work at very well, all. It  had the generic VGA driver and NO network driver. This made it hard for it to get network disk drivers.

As it turns out, the virtual ethernet control looked close enough to the VMware AMD PCnet device that it was trying to use that driver, which of course failed. Virtual Box comes with some "guest tools" that can be installed which fix the problem. I had to install the guest tools inside the XP image (mounted as CD from ISO image). I also ran the 'unpack drivers' step from the command line based on their instructions to unpack the drivers into a local directory, although I'm not sure that was needed.  After installing these tools, the network adapters STILL didn't work. They were still trying to use the VMware drivers.

I fixed the problem by using "update driver" from the Device manager, then picking my own specific location and driver. It already recognized that it had the VBox AMD PCnet driver installed, but some how was priortizing the VMware one. I simply selected the VBox adapter and it started working.

Another note: I chose 'bridged adapter' in the configuration simply because the Cisco VPN client I was using in my image works better with that. I suspect it would work fine with NAT as well.

The 'guest tools' also installed and fixed the display driver so it ran a little better.

Overall: Vbox seems to be running very smoothly. I like it so far.


Side note: VirtualBox runs on Intel Macs, as well.


Rich