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.

Is it possible to, say, run VirtualBox on Windows 7 with a Linux guest, and inside that Linux machine run Bochs?

The reason is that I'm interested in starting OS development, and I've found that all the tutorials and stuff are much easier to follow on *nix machines. I tried using Cygwin, but I think it's adding another layer of complexity and not necessarily making things easier.

share|improve this question
    
Dual booting is Linux and Windows is relatively easy to do, and the end result runs much more quickly. The only real downside being you have to reboot to switch OSes. –  lyallcooper Jul 19 '11 at 20:44
    
@AUAnonymous: I know that, but I want to keep running Windows. –  Javier Badia Jul 19 '11 at 20:58
    
It's just always an option if you don't manage to get the VMs working or if they don't work too well. –  lyallcooper Jul 19 '11 at 21:11
    
While you could do a great deal of work with this sort of setup, I strongly urge you to investigate Simics if you are going to be writing a serious kernel. The insight and debugging alone are priceless, however it is rather expensive. –  Tim Post Jul 20 '11 at 3:11
1  
I'm going to argue that this question is poorly titled. Bochs isn't virtualization software in the same sense as VirtualBox and VMWare. It is an emulator. It offers no CPU virtualization. The distinction here is not merely pedantic. You can expect an emulator like bochs to work inside a VM with fairly high confidence. Running a true virtualization software "nested" in a VM is a much trickier problem. For example, this feature was only implemented in VMWare as of Fusion 4. –  superbatfish May 22 '13 at 22:03
add comment

4 Answers

up vote 23 down vote accepted

Long story short: yes.

Each virtual machine is technically "independent" of one another, and with VirtualBox, you could easily do this, since it is supported on both Windows and Linux host operating systems (emulated or not). You could simply use Windows as your "base-host" OS, run Linux in a VM, and then use that operating system as the new base-host for Bochs.

Do note that your only limitation here is your hardware. Depending on the requirements of your development, you may require more memory, or an upgrade to a 64-bit "base-host" operating system. That being said, if you choose your Linux distros wisely, any modern system should be capable of arbitrary nesting like this.

You will see improved performance if you enable x86 virtualization support on your computer (if your motherboard and CPU support it), and AFAIK, you can "pass through" this feature to multiple nested virtual machines. If we have n virtual machines nested in eachother, this is supported so long as the 1st to the n-1th nested guest OS has support for x86 virtualization (the base host must also support it). Do note that there are still some security issues to be aware of if you do this, so take the appropriate precautions.

share|improve this answer
    
It seems it actually works. After all, if I needed speed I wouldn't be using Bochs in the first place. While not the most upvoted, I feel your answer is the more complete and to the point, so I'll accept it. –  Javier Badia Jul 20 '11 at 4:16
    
Is it just me, or doesn't this answer seem to be about running multiple virtual machines, not nested ones? –  Thomas Padron-McCarthy Jul 20 '11 at 6:41
    
@Thomas Padron-McCarthy, I was talking about nested ones. I modified the answer to be more explicit with this regard. –  Breakthrough Jul 20 '11 at 10:21
1  
Bochs is not the best test-case for this general question, since it is an emulator, not a VM. (See my comment on the OP.) –  superbatfish May 22 '13 at 22:06
add comment

I sometimes run a whole VMware vSphere virtual infrastructure within VMware Workstation, along with virtual Cisco routers and switches and EMC Celerra Virtualized Storage Appliance, for self-learning and testing purposes.

I call it 'Inception Computing', and it can get pretty confusing. It is however somewhat cheaper than using the real gear.

share|improve this answer
1  
This should prove the viability of this. vinf.net/2010/02/25/… –  Mike Soule Jul 19 '11 at 22:55
1  
@Mike: Your link details running ESXi within ESX, but I have used some of the links, like TechHead, which is one of the main sites which got me into virtualisation in the first place. There is a lot of information on running a vSphere infrastructure within VMware Workstation as well: google.co.uk/… –  paradroid Jul 19 '11 at 23:17
    
You know that the term "inception" doesn't refer to the [thing within a thing] concept, right? –  countfloortiles Aug 16 '13 at 22:51
    
@countfloortiles: It's a reference to the film, of course. –  paradroid Aug 17 '13 at 14:03
add comment

Linux-KVM has some support for nested virtual machines. I've asked on the KVM IRC channel and have gotten the following information (but don't take my word, try it yourself):

  • AMD CPUs should work well, guests with Xen and Hyper-V are known to work,
  • Intel CPUs need the latest KVM Git source code, and only guests with KVM work

I haven't tried this myself yet. A search for "KVM nested" should give you enough info to try it yourself.

EDIT: KVM will run on a Linux host only. I haven't gotten any reliable info on Windows virtualization software concerning proper nested VM support. By 'proper' I mean that the hypervisor exposes virtualization extensions to the guest. You can always run a nested VM using a pure software hypervisor (e.g. dynamic translation), but that will be noticably slower.

EDIT: Bochs, which you mentioned, is a software-only hypervisor. This means that it will always be slow, and it's irrelevent if the hypervisor on the host exposes virtualization extensions to the guest (like KVM does). Most other virtualization softare (KVM, VirtualBox, VMWare) however can make use of those extensions and will perform much better if they are available.

share|improve this answer
    
To your second edit: So if I'm just going to be running Bochs (and I don't care too much if it's slow), do I need to worry about the KVM thing? –  Javier Badia Jul 19 '11 at 20:08
    
If you're running Bochs inside the virtual machine, it will be ass slow as if you ran it on hardware (assuming your hardware has virtualization extensions, i.e. AMD-v or VT-x and they are enabled in BIOS; otherwise it will be even slower, as will everything in the VM). –  Ambroz Bizjak Jul 19 '11 at 22:15
add comment

Its possible, but not very feasible, especially for development. You should probably look at running Linux as your native OS, or getting a second box to host the VMs on.

share|improve this answer
    
I understand that it's likely to be complicated, but what exactly do you mean by "not very feasible"? –  Javier Badia Jul 19 '11 at 17:58
1  
I would bet that @peelman means: "It is too slow for practical purposes." I haven't tried it myself. –  CarlF Jul 19 '11 at 21:06
    
@carlf precisely. –  peelman Jul 20 '11 at 4:11
add comment

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.