Dec 4, 2010

How to Run Ubuntu in Virtual Machine From Windows

At work I now work a lot with Visual Studio on Windows 7 Professional. While I have to use Windows, I don't want to loose the functionality and power of Linux, so I run a virtual machine with Ubuntu Maverick. Both Windows and Linux run smoothly on my machine and I can share files among them. In this post I give some help for setting this up.

I chose Oracle's VirtualBox (also: VBox) as virtual machine. This decision was motivated mainly by speed. I tried Qemu and it was too slow to be usable. Bochs is also reputed to be slow, I didn't even try it. I found a performance comparison between VMWare, VirtualBox, KVM, and Xen. Most important I found operations per second on guest OS and I/O overhead. The reviewer concludes

To me, it seem that VMware and VirtualBox are the fastest virtual machine across the board. They have good CPU/memory performance, good disk access time and good network layer speed. 

KVM is, instead, a mixed beast: it has quite good CPU/memory and network speed, but it fail in the crucial I/O subsystem performance more often than not.

Xen is at the opposite end of the spectrum: it as respectable I/O access time but quite bad CPU/memory performance that, in turn, can badly influence network speed and CPU load also.

Installation of VBox is straightforward. It follows a short howto on sharing folders between a VirtualBox virtual machine with a Windows host and Linux guest OS.

  1. Install VirtualBox guest additions on the linux guest OS:
    1. in the running guest OS window, go to devices, install guest add-ons.
    2. make the VBox Additions iso available as drive: devices->CD/DVD->VBoxGuestAdditions.iso
    3. in the terminal (assuming the iso is automatically mounted as cd, which it is in Ubuntu): i) cd /media/VBOX... (exact name depends on version) ii) sudo sh VBOXLinuxAdditions-x86.run (or the corresponding 64 bit version)
    4. maybe you need to restart your guest OS.
  2. Share folder:
    1. in the VirtualBox guest OS window menu go to devices->shared folders and choose the host OS folder and a name for it under VirtualBox, say VBoxShare. You can choose permanent and can make it read-only if you want.
    2. in the guest OS linux terminal: sudo mkdir /media/WindowsShare; sudo mount -t vboxsf VBoxShare /media/WindowsShare
    3. you can put this also in fstab to have the share folder come up automatically on every boot: sudo gedit /etc/fstab

      VBoxShare /media/WindowsShare/ vboxsf defaults 0 0

Enjoy. Please leave a comment below for questions and suggestions.

6 comments:

  1. Hey thanks for the step by step information on how to run a virtual machine with Ubuntu. I was wondering if there was a way to share files among Windows and Linux. Thanks for the link to VirtualBox. I hope the installation is as easy as your illustration.

    ReplyDelete
  2. @Jason: Installation was easy as a pie. File sharing between host and guest is just a few clicks away.

    ReplyDelete
  3. Ι ωish this worκed propеrly on аnԁгoіd.

    .. аlthough if it did I wοuld
    ρгobably just maκe stuff liκe thіs аll dаy and
    not get anythіng done...

    my webρagе; cheap personal loans

    ReplyDelete
  4. More specifically, just such a woman walked into his classroom. Jobs had agreed to give one of the ��View from the Top�� lectures at the Stanford Business School one Thursday michael kors outlet evening. Laurene Powell was a new graduate student at the business school, and a guy in her class talked her into going to the lecture. They arrived late and all the seats were taken, so they sat in the aisle. When an usher told them michael kors hamiton they had to move, Powell took her friend down to the front row and commandeered two of the reserved seats there. Jobs was led to the one next to her when he arrived. ��I looked to my right, and there was a beautiful girl there, cheap Michael Kors purses so we started chatting while I was waiting to be introduced,�� Jobs recalled. They bantered a bit, and Laurene joked that she was sitting there because she had won a raffle, and the prize was that he got to take her to dinner. ��He was Moncler Outlet Online so adorable,�� she later said.

    After the speech Jobs hung around on the edge of the stage chatting with students. He watched Powell leave, then come back and stand at the edge of the crowd, then leave again. He bolted out after her, brushing past the michael kors outlet online dean, who was trying to grab him for a conversation. After catching up with her in the parking lot, he said, ��Excuse me, wasn��t there something about a raffle you won, that I��m supposed to take you to dinner?�� She laughed. ��How about Saturday?�� he michael kors crossbody bag asked. She agreed and wrote down her number. Jobs headed to his car to drive up to the Thomas Fogarty winery in the Santa Cruz mountains above Woodside, where the NeXT education sales group was holding a dinner. But he suddenly stopped and turned around. michael kors outlet ��I thought, wow, I��d rather have dinner with her than the education group, so I ran back to her car and said ��How about dinner tonight?���� She said yes. It was a beautiful fall evening, and they walked into Palo Alto to a funky vegetarian Michael Kors crossbody restaurant, St. Michael��s Alley, and ended up staying there for four hours. ��We��ve been together ever since,�� he said.
    and Lisa told her that she hadn��t been able to finish it. Simpson told her she Michael Kors outlet online sale would like the ending. Over the years Lisa had an on-and-off relationship with Simpson, but it would be closer in some ways than the one she had with her father.

    ReplyDelete