Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Question: I currently have a dual boot: Win 7 x64 Pro & Ubuntu 10.04.1 x64. Is there a way to boot Win 7 as a virtual machine under Ubuntu without reinstalling anything, in addition to maintaining the ability to dual boot?

Background: I have a dual boot system with Windows 7 installed on one partition in a Raid 5 and Ubuntu 10.04.1 installed in a separate partition (actually split across three) in the same Raid 5. I have a Core i7-930 with 6GB of RAM. I'd be happy to provide any other hardware specs.

I require Windows 7 x64 Pro for only a small number of things, basically just VS 2008 / VS 2010 so that I can use nSight from nVidia to debug CUDA / OpenCL projects.

I must be able to dual boot because (and this is more just my suspicion) I don't want any more between the software and the three graphics cards that I have installed than is absolutely necessary. If it means anything, when in production mode where I'm running without virtualization, I have two cards set to exclusive mode and one set to prohibited mode (to drive the display). I'm worried that running nvidia-smi under either Ubuntu as the host OS or Win 7 as guest OS might bollux things up.

I don't know much about Xen, KVM, etc. I've played around a bit with them, but I'm more than willing to use any virtualization software as long as it's free and it can accomplish what I want. Note that I'm a student -- this is all non-commercial development.

I can, if absolutely necessary, reinstall everything, but I had many, many problems getting the CUDA environment to work under VS 2010 -- I installed/uninstalled/reinstalled VS '08 & '10 so many times that it corrupted the Win 7 registry and I had to start over from scratch. Now that it's working as a dual boot, I'd really like to avoid starting from scratch a fourth time.

share|improve this question
    
I didn't even manage to run CUDA programs let alone debug them in a virtual Windows. However, my try is like 18 month old, maybe today things are better. –  fschmitt Oct 1 '10 at 17:03
    
Yeah, I'm hoping that it's possible now if I use an L1 (Xen?) hyper-visor. Not sure if it's possible... –  M. Tibbits Oct 2 '10 at 13:32

2 Answers 2

The on-topic part: yes, you can run a virtual machine under Ubuntu.

CUDA requires direct access to the hardware. That means you'll have to run Windows either directly on the hardware or on a virtualization engine that allows a virtual machine to access hardware devices directly. That pretty much means hypervisor-based virtualization. VirtualBox is definitely out. Google suggests that Xen will do.

Running a single Windows installation in different hardware configurations (such as the bare metal and a virtual machine) is notoriously difficult. If you really don't want to install Windows, you might prefer to run Ubuntu in a VM under Windows.

It's not clear from your question whether you also want to run CUDA programs in Ubuntu. If you do, you can boot your existing installation on pretty much any hardware, there's little if any setup required. This does require a virtualization system that can bind a disk partition inside a VM, which I think VMWare can do but not VirtualBox. (It's also possible with VirtualBox by making a custom initrd with the vboxsfs module, but that's no longer no-setup-required. An alternative method is to clone the system partition to a virtual machine disk.) ADDED: You might want to investigate AndLinux, which is a port of Ubuntu to CoLinux, a Linux port running on top of Windows; I don't know whether CoLinux can support CUDA.

Given your workflow, I think your best bet is Xen. If this turns out not to work so that you need to dual boot, note that both OSes support hibernation, so with the right setup you can switch relatively quickly between the two (without needing to log in, restart all programs, etc.).

share|improve this answer
    
Yes specifically I would like to run a single Windows installation in both hardware configurations: bare metal & a virtual machine. So my question, two part, is this: (1) Is this possible -- hard maybe, but possible? (2) How would I go about doing it? As to your other point, yes it was my goal to run CUDA code within a Linux only environment, but what I've found is that the only good profiling software requires Windows 7 or Vista (man I hate Vista) and VS 2008 / 2010. So my plan is to profile my code in Windows and then switch back to Linux to do final testing & production. –  M. Tibbits Oct 2 '10 at 8:53
    
@M. Tibbits: For the Windows questions, this isn't an appropriate forum (and I don't know the answers anyway); I suggest Super User. –  Gilles Oct 2 '10 at 10:06
1  
I understand -- I just asked it there also -- but since I was trying to setup Ubuntu "at the bottom" and visualize on top, I came here. –  M. Tibbits Oct 2 '10 at 15:42

I'm unclear on what you are asking. Are you asking if there are legal reasons why you cannot use the same license to run from regular boot and a VM, the answer is that Microsoft claims you cannot and Windows authentication requires you to buy a second license.

If you are asking about the technical problems then I think Giiles has answered them fairly well.

share|improve this answer
    
I am not attempting to delve into licensing issues within this post. I can pursue these questions in a more appropriate forum, but for the purposes of my question(s): Should I need a second or third legal license for Windows 7, etc this is not a problem. As for the client software, I'm using VS 2008 / 2010 through the DreamSpark initiative -- so it's already free to me. –  M. Tibbits Oct 2 '10 at 8:57

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.