Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

First I have to add that I do not know how to explain what I want in the title so if anybody has a better idea be my guess. Here it goes:

I have Windows 7 installed in one of my hard drives. The whole drive is for Windows. As I installed Windows 7 on it, it partitioned the drive into 2 parts. One is called the "System Reserved" and the other is where Program Files and the rest of the directories are.

I wish to run this Windows 7 already installed, in some kind of Virtual environment (Like virtualbox, xen or similar) from Ubuntu. Is there a virtual environment that I can tell it to run this windows 7 from within Ubuntu.

I may be going out of the box out here but is this possible with any tool that Ubuntu comes with.

share|improve this question
    
Is there any tools to convert partition to vdi file –  Tachyons Feb 14 '12 at 23:04
    
Why don't you make a ISO of your System and then install it into the VM? –  Uri Herrera Feb 14 '12 at 23:20
1  
In theory, you can boot your windows partition from virtualbox (or KVM) , but it is technical and prone to errors. See johanv.org/node/164 or google search for similar. IMO it is better to migrate the windows install to a virtual disk. See - virtualbox.org/wiki/Migrate_Windows - again it is "untested" with windows 7 –  bodhi.zazen Feb 14 '12 at 23:20
add comment

1 Answer

up vote 1 down vote accepted

I'd suggest installing virt-manager and virtualisation infrastructure, libvirt-bin. You should be able to use virt-manager to create a virtual machine for your Windows 7 install.

This will run the OS in a KVM virtual machine. Unfortunately, you may find that the system is a little slower than when run natively. If performance is a concern for you (are you looking to run games?), then you may want to look into a VMWare or virtualbox solution instead. If performance isn't a big issue, then I'd recommend using KVM, as it works well within Ubuntu, and is completely open source.

To do this: use the virt-manager program to create your new Windows VM.

In the configuration screens, you should simply be able to connect the existing disk (eg, /dev/sdb) to the new virtual machine, and use that disk as the boot device.

No need to convert your disk to any other type of virtual storage, it should be usable as-is. I've used this method to test out the Windows 8 beta, so I assume it will work with Windows 7.

In case it helps, here's my virtual machine configuration (generated with virsh dumpxml <name>):

<domain type='kvm'>
  <name>win8</name>
  <uuid>---uuid removed---/uuid>
  <memory>2097152</memory>
  <currentMemory>2097152</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-1.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/sdc'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' unit='0'/>
    </disk>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:0e:17:a5'/>
      <source network='isolated'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </interface>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </memballoon>
  </devices>
</domain>
share|improve this answer
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.