Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The scenario:

  • I am a freelance software developer that mostly develop on Linux (Python, MySQL, MongoDB etc.)
  • My work computer is a Lenovo laptop w/ a i7 processor and 8GB RAM. Big HD + 128 GB SSD. The OS is Ubuntu Linux

I might get some .NET/C# projects in the near future, I am therefore looking for some guidance on the following:

  • Should I go for a dual-boot solution or use virtual machines for Windows stuff?
  • If I go dual-boot: What is the recommended installation sequence? Windows first or Linux first? (I'm looking at a complete Ubuntu reinstall to get the latest LTS anyway so I can start install everything fresh)
  • If I go VM: How does VMWare Workstation and VirtualBox compare performance-wise?
  • My dream setup would probably be the following:
    • Dual boot
    • But if I boot into Linux, I can boot the Windows partition as a virtual machine. Is this possible?
    • And/or: If I boot into Windows, I can boot the Linux partition as a virtual machine. Is this possible?
share|improve this question
3  
You should always do Windows firsts then Ubuntu since you want Grub to replace the chain-boot the Windows Bootloader. There are several dozen questions on how to do that. Performance decisions should be made yourself –  Ramhound Jun 25 at 17:46
    
Visual studio is an intense application, and may or may not run sufficiently well in your virtual environment. –  Frank Thomas Jun 25 at 18:10

7 Answers 7

up vote 5 down vote accepted

Others have covered the rest of your question, but I see they have left this part unaddressed:

But if I boot into Linux, I can boot the Windows partition as a virtual machine. Is this possible? And/or: If I boot into Windows, I can boot the Linux partition as a virtual machine. Is this possible?

The short answer is yes.

The long answer is yes, but with number of caveats and implications.

Until this January (when we got new machines), I had my work computer configured to either dual boot, or to use Linux as a host for a Windows 7 VM which directly accessed the Windows partition. I never bothered trying to use Windows as a host for a direct-disk Linux VM, but it is also possible. My computer used legacy BIOS/MBR, I am not sure how to do this if you use UEFI/GPT.

I chose VirtualBox to do it, but from what I understand it should also be possible with VMWare.

Performance was perfectly acceptable for my purposes; I gave Windows 1 CPU core, 2GB of memory, 1 monitor, and I don't remember how much video memory. The VM was capable of playing video and working with my Java GUI application and many rich-content websites.

I'll discuss the weirdness before going into details:

  • Switching between Native-boot and VM-mode Windows 7 triggered Windows's warning that my copy of Windows was not be genuine. Depending on your license, MS may consider this a breach of license by installing on two pieces of hardware. I also needed to "repair" my installation because many of the low-level drivers are different for the real hardware and the VM "hardware."

  • Every time Windows Update ran (or any other large disk I/O operation), my hard disk was crushed under load and everything on both machines became dog slow. Moving each OS to its own dedicated hard drive fixed this problem nicely; using a solid state drive would have also solved the issue.

  • For some reason, Ubuntu occasionally didn't like waking up after suspending (maybe 20% of the time), which was the equivalent of a hard power-off for my Windows VM. As a result I would power down the VM every evening before suspending the host.

  • I had to be very careful to never attempt to mount the Windows partition in Linux to prevent possible data corruption/loss. I quickly added a udev rule to prevent this.

Alright, if that doesn't sound too bad, here are the details: The most useful reference I found to do this is this blog: http://www.rajatarya.com/website/taming-windows-virtualbox-vm. Here are the steps summarized:

  • RTFM. Really. You will be using commands that could corrupt your file system if done wrong.

  • Find the partitions.

  • Change the permissions for your partitions (alternatively you could boot your VM using sudo, but then any files created on the host/guest shared drive will be owned by root).

  • Create an MBR so the guest doesn't try using the normal bootloader.

  • Use a VirtualBox internal command to create the vmdk image to use for the VM.

  • Create the VM. Have it use the vmdk you just created.

  • Boot and repair your installation.

I would expect to find many of the same issues using a Windows host, but Linux would probably handle the different hardware more elegantly. It really might be easier though to use a shared /home (and maybe /opt) partition(s) and just have different root partitions for the native vs guest machines.

share|improve this answer
    
I've taken the VM approach on Macs for years and I find even an SSD doesn't cut it on it's own. You need to separate your host and guest on totally different drives to prevent either system becoming I/O bound. Although an SSD does improve things it's nothing compared to using a second drive (and if they're both SSDs you're flying!) –  Keith Jackson Sep 6 at 14:02

I do the opposite generally, that is my home system is a Windows 7 machine and I run various flavors of Linux as VM's. Being as Linux can function quite nicely with limited resources, this works for me even though I only have 4GB's of RAM (mind you this does mean I run a single VM at a time and typically give it 1024MB of RAM at the most to keep plenty for Windows).

Your 8GB's of RAM should allow you to run a Windows VM quite easily. I think the only big question here is the type of results you will be wanting to measure for your development. I would be hesitant to rely on any performance/throughput metrics for items you develop in a VM (unless it is going to be deployed to a similar VM environment with the same specs across the board). Otherwise you should be good to go.

And to touch on comments in other thread, naturally if you are going in knowing that you will be developing applications that require a large amount of resources, then optimizing for that end would be the way to go (so in those cases dual boot would certainly be preferable to using VM's).

I've used both VMWare and VirtualBox, and I have not seen any real performance hits using either. I have not gone to the extent of benchmarking the VM's within, I just have simply not noticed any negative impact from either platform (Still use VirtualBox at home, and VMware at work).

share|improve this answer
    
If your Linux handles running on 1GB of RAM in a VM, that means you can easily run Windows in a VM and assign 3GB of VRAM as well. In the case of the question, the same theory goes. Keep 1GB for your base Linux OS and assign 7GB to Windows. It doesn't really matter what the base OS is and the VM. As long as you're running both, you're sharing the same resources. To me, it doesn't really matter, both OS'es are happy to run in a VM and if you have the resources to run both, it's always nice to be able to swith between them without having to reboot. –  Jakke Jun 26 at 4:17
    
I prefer VirtualBox to run my VMs, because I've seen serious memory leaks in VMware Player AND Workstation (version 10). I am talking about >4 VMs running at the same time though, on a system with 32GB RAM. Both VW products start using all the ram until it crashes, while VB is happily running for weeks without any issue. –  Jakke Jun 26 at 4:19

Or how abou this. You're interested in .net/C#, so why not just use Mono on linux? Its very cross platform in the sense java is.

share|improve this answer
    
Exactly my thoughts - I played with making a simple single-window C# Othello game on Visual studio, and it ran just fine when importing the project and running on MonoDevelop. –  NoBugs Jun 26 at 4:34
2  
As a caveat, Mono does not support WPF projects. So if the OP is looking to develop WPF applications, that will not work. Also, I was a big fan of Mono, but since Novell's abandonment of the project and Xamarin's choice in handling the new state of affairs, I am a bit cautious about investing more effort in it. –  Boluc Papuccuoglu Jun 26 at 8:18
1  
I have considered using mono, and will definitely try it out. But there could be issues when other team members use Visual Studio? –  codeape Jun 26 at 9:06
    
You would really miss out on .NET fun if you're not using Visual Studio. –  demonkoryu Jun 26 at 12:48
2  
@codeape There are a lot of unsupported features and libraries in Mono; this probably isn't a serious option if your client isn't specifically interested in targeting Mono. –  emodendroket Jun 26 at 15:42

It depends on how you work and how you want the os to feel.

Dual booting means restarting and booting if you wish to change the OS, this takes time. As you freelance, do you work 8 hours straight with a project without doing "your" stuff ("your stuff" would be you on your linux boot).

If you work 8 hours in a row in Windows, and then spend the rest of the day in Linux, use dual boot. If you work 30min and then want to do something in Linux, switch to working again for 3 hours, then into linux again etc. Then I would choose VM.

If you are unsure do both. Dual boot and when in windows run a VM. You will see a clear difference between both and you WILL prefer one over the other.

I personally only use a vm for testing new linux dists and sometimes a fake server when devloping (being able to screw up on a vm is priceless and so much less hassle that doing it on your actual harddrive.). VM also lags and feels less responsive, I need my os to feel responsive and smooth, the VM lacks in this area. So I prefer dual boot.

There is also an issue when it comes to sharing files. It's more work to share on a dual boot(imagine editing a file in windows boot then booting in linux only to realize that you missed a line and have to reboot into windows, the nightmare!) where on a vm you can use NFS or samba to share files between the os in real time, no probs.

Also about not enough ram as Aboba said, rubbish I say. I run 4gb and a VM in Windows8. Remember though about what resources your project needs.

share|improve this answer
    
About sharing files: I really, really, really hope you have everything you work on under source control in which case the point becomes moot. Things you still want to share between windows and Linux (because.. I don't know) just go on a NTFS partition - that can be read and written to by both OSes. –  Voo Jun 25 at 21:27
    
GIT 4 life ofc! I do a lot of private programming so I don't need git for that (i know i know itäs good practice but im lazy). About the NFTS, that was exactly what I was saying! however booting between os's takes time. And in a vm both files are availabe in real time! –  Karl Morrison Jun 25 at 21:39
    
My Ubuntu Partition automatically mount the all partitions of Windows, So atleast access file system/files of windows should not be issue. Also Their are 3rd party software to mount EXT3/4 partitions on windows. –  kuldeep.kamboj Jun 26 at 11:10
    
Another consideration is whether you want to do Windows Phone development. If that is the case, you cannot run Visual Studio in a virtual environment, since the WP emulators are themselves Hyper-V VMs. You could run Windows 8 with client Hyper-V enabled, Linux in a VM under that and still have access to the emulators for WP development. –  rjrapson Jun 26 at 14:54

According to my experience( I also work on .Net apps while test cool stuff and solve algo problems on linux), dual boot will be your best bet.

As others have pointed out, using a VM feels slow and unresponsive at times, which can be a pain.

One more thing I would point out it that take your time and try running a VM and check if you are comfortable with it.

As for the order
1) install windows first and then linux (preffered)
2) Install linux first then windows(then you have to reinstall bootloader )

One more thing I would like to add is that for small .Net projects you can use even linux using mono, so no need for switching to and fro from windows to linux.

share|improve this answer

I've been doing a lot of switched linux / Visual Studio development for just over a year now, starting with Visual Studio and moving to linux over time (I like apt, zsh and vim!).

I started with Windows hosting Ubuntu in VMWare Player, which worked fairly well, certainly great if you are primarily doing Visual Studio development and merely occasionally need some linux only package or whatever. Over time I found I wanted my work to be in the linux environment more often and the VM integration had a few pain points, so...

As I switched to primarily linux development (lots of AS3 in IntelliJ and some node + python) with only occasional need for Windows (ASP.NET site), I flipped that around to Ubuntu hosting a VirtualBox (using a disk2vhd -> .vdi of my old windows disk). After a fair amount of fiddling I'm fairly happy with this given the split of work I generally have, but if you're doing any serious amount of Visual Studio you probably want Windows hosting Linux, either VirtualBox or VMWare Player should be fine.

I should note a few pain points though: with the standard Ubuntu 14.04 AMD video drivers VirtualBox's 3D acceleration makes Visual Studio ~10-100x slower, so disable the acceleration at the cost of some sluggishness; and you really want to be running on an SSD)

share|improve this answer
2  
Just noting that answers saying "You don't have enough ram" is fairly crazy sounding to me: VS itself is 32-bit so it can't use more than 4GB. You might have some sluggishness if you're running full editions of IIS with SQL Server, but the normal Express versions of those should be fine. SSD is far more important for performance. –  Simon Buchan Jun 25 at 22:44

Personally I have had many positive experiences taking the half way house, use a hypervisor such as Xen you can then have both Linux and Windows running under a light weight micro-kernel hypervisor, neither take a significant performance hit and this configuration is far more flexible, allowing you to easily reallocate resources between the two at any time.

This nearly matches your dream setup mentioned as you can boot or shut down the two OSes independently at any time to reallocate resources to the other and you will not be able to notice any performance hit (in reality it may be a fraction of a % slower is some cases but you will not notice this unless you are benchmarking specifically to test this).

The only catch is certain features require your CPU to support visualization however every i7 does (afaik) so this should not be an issue for you.

EDIT:

Xen contains its own microkernel, Debian is not needed to run it, the only reason one would need a linux system is to reconfigure Xen as the configuration program is a linux program which you run on one of the guests (guest is the term Xen uses to mean a VM). You can have just linux, just windows or both running at any time, but you will need linux running in order to configure Xen's settings so it is advisable to leave a small linux running in the background to do this when needed.

Hardware can be handled in a few ways, Xen provides a set of virtual devices which allow a piece of hardware to be used by multiple guests at once such as network cards and sound cards etc.

For hardware which cannot work this way or is only needed by one guest at a time xen has pass-through devices, this means you can select and choose at any time which guest has direct access to the piece of hardware and can switch this at any time. This can be done to give a specific guest true access to the graphics card if you need to high speed accelerated rendering without any virtualisation overhead.

It is also possible to have one guest directly using the graphics card in pass-through mode as explained above but still view others using a local VNC like protocol which makes the screen's of other guests appear in windows (think like virtual box or remote desktop) while one has direct control of the graphics card; or of course you can just switch between guests screens giving one direct access at a time.

Contrary to what you may assume about the efficiency of this setup it is in fact one of the few ways to run both OSes at the same time while maintaining effectively native performance in both, if you do some googling you will find many have had success using such a setup to run a high performance gaming machine or other demanding systems.

share|improve this answer
    
OK so this approach means booting into Debian+Xen, and then having Linux and Windows running as VMs inside? How is hardware handled in this setup? Will the guest OSes be able to use (for instance) the graphics card directly? –  codeape Jun 26 at 11:02
    
@codeape Please see my edited answer which should hopefully answer your questions. –  Vality Jun 26 at 15:41
    
Great answer, thanks! –  codeape Jun 27 at 9:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.