From: Philip Rhoades I can ssh from/to the host/guest OK but how do I set up a route (or whatever is necessary) so that another machine: eth0: 192.168.0.12 can ssh to the guest? - "ssh 192.168.122.68" gives "no route to host" - http://docs.fedoraproject.org/virtualization-guide/f12/en-US/html/ but the problem does not seem to be covered there.
Alexander is correct in saying that bridging would allow you to do that.
There are two networking discussed in the guide.
The first is a NAT (network address translation), in which the guests are given "private" ip addresses and any outbound traffic appears to be coming from the host machine's IP address. This is the same as the setup on your ADSL router where the internal network machines get addresses of 192.168.x.x but the internet sees your requests as coming from the IP address of your router.
There should be lots of documentation in linux firewalling guides under sections on NAT (or possibly called IP Masquerading in some). Have a look at these for information on port forwarding to reveal services inside the virtual (such as ssh).
The other option is bridging. This shares the physical network interface of the host with the guest. In this case the VM acts as though it's a machine plugged into the same subnet as the host, its services are accessible like those of the host and it's as vulnerable to attack as the host.
Robert
On Tue, 2009-11-24 at 11:03 +1000, Robert Thiem wrote:
The other option is bridging. This shares the physical network interface of the host with the guest. In this case the VM acts as though it's a machine plugged into the same subnet as the host, its services are accessible like those of the host and it's as vulnerable to attack as the host.
... and instructions on how to configure this mode are available here:
http://wiki.libvirt.org/page/Networking#Fedora.2FRHEL_Bridging
Cheers, Mark.
People,
I have found some threads (here and elsewhere) about doing this but they all seem to come back to the same problem - that the virtual guest treats the hard disk partition differently from how real Windows treats the partition - so it makes it difficult to be able to both dual-boot the Windows partition and also use the Windows partition in a Windows guest setup on Fedora. Has anyone worked out how to do this conveniently?
Thanks,
Phil. -- Philip Rhoades
GPO Box 3411 Sydney NSW 2001 Australia E-mail: phil@pricom.com.au
On 12/31/2011 05:35 PM, Philip Rhoades wrote:
People,
I have found some threads (here and elsewhere) about doing this but they all seem to come back to the same problem - that the virtual guest treats the hard disk partition differently from how real Windows treats the partition - so it makes it difficult to be able to both dual-boot the Windows partition and also use the Windows partition in a Windows guest setup on Fedora. Has anyone worked out how to do this conveniently?
Thanks,
Phil.
When you give qemu-kvm a partition to use as disk for a guest, it does exactly that. It uses the partition as a disk for the guest. So, the guest sees a *disk* while in the physical situation it's a *partition*. You may be able to do what you want by attaching a whole disk to the guest, instead of just the partition.
Caveat 1: I would strongly recommend to use a second, separate physical disk for your windows boot, instead of running your host and the guest from the same physical disk. If multiple operating systems are writing to the same area of the disk at the same time, you can get nasty data corruption, which is one reason you usually attach only a designated partition to the guest, instead of a whole disk.
Caveat 2: You of course already know this, but Windows is not designed to be run in this configuration (same installation runs physical as well as virtual), so you may run into unexpected issues, even if you get it to work.
Emanuel
On 01/02/2012 03:38 AM, Emanuel Rietveld wrote:
When you give qemu-kvm a partition to use as disk for a guest, it does exactly that. It uses the partition as a disk for the guest. So, the guest sees a *disk* while in the physical situation it's a *partition*. You may be able to do what you want by attaching a whole disk to the guest, instead of just the partition.
I've often thought that it should be possible to cook something up with device manager -- essentially creating a "wrapper" that provides a MBR, etc. around a Windows logical volume or partition. Might be a fun project for someone.
Caveat 2: You of course already know this, but Windows is not designed to be run in this configuration (same installation runs physical as well as virtual), so you may run into unexpected issues, even if you get it to work.
The biggest issue I would expect would be constant requests to "reactivate" the Windows VM/system.
On 01/03/2012 06:42 PM, Ian Pilcher wrote:
On 01/02/2012 03:38 AM, Emanuel Rietveld wrote:
When you give qemu-kvm a partition to use as disk for a guest, it does exactly that. It uses the partition as a disk for the guest. So, the guest sees a *disk* while in the physical situation it's a *partition*. You may be able to do what you want by attaching a whole disk to the guest, instead of just the partition.
I've often thought that it should be possible to cook something up with device manager -- essentially creating a "wrapper" that provides a MBR, etc. around a Windows logical volume or partition. Might be a fun project for someone.
I'm sure its possible to do that but it may require some hack of presenting a the original MBR as some type of shadow one for the guest or other trick. Ric, have you played w/ it?
Caveat 2: You of course already know this, but Windows is not designed to be run in this configuration (same installation runs physical as well as virtual), so you may run into unexpected issues, even if you get it to work.
The biggest issue I would expect would be constant requests to "reactivate" the Windows VM/system.
Right. Some versions of windows license (VLK) ignore that too.
On Thu, Jan 05, 2012 at 10:27:29AM +0200, Dor Laor wrote:
On 01/03/2012 06:42 PM, Ian Pilcher wrote:
On 01/02/2012 03:38 AM, Emanuel Rietveld wrote:
When you give qemu-kvm a partition to use as disk for a guest, it does exactly that. It uses the partition as a disk for the guest. So, the guest sees a *disk* while in the physical situation it's a *partition*. You may be able to do what you want by attaching a whole disk to the guest, instead of just the partition.
I've often thought that it should be possible to cook something up with device manager -- essentially creating a "wrapper" that provides a MBR, etc. around a Windows logical volume or partition. Might be a fun project for someone.
I'm sure its possible to do that but it may require some hack of presenting a the original MBR as some type of shadow one for the guest or other trick. Ric, have you played w/ it?
Xen used to synthesize an MBR in the guest.
As Ian asked above, it's possible to do this with device-mapper too, although I doubt it's a good idea, but here's how you'd do it anyway:
https://lists.fedoraproject.org/pipermail/virt/2010-September/002288.html https://rwmj.wordpress.com/2010/09/30/technique-for-synthesizing-a-partition...
Rich.
Rich,
On 2012-01-05 21:05, Richard W.M. Jones wrote:
On Thu, Jan 05, 2012 at 10:27:29AM +0200, Dor Laor wrote:
On 01/03/2012 06:42 PM, Ian Pilcher wrote:
On 01/02/2012 03:38 AM, Emanuel Rietveld wrote:
When you give qemu-kvm a partition to use as disk for a guest, it
does
exactly that. It uses the partition as a disk for the guest. So,
the
guest sees a *disk* while in the physical situation it's a
*partition*.
You may be able to do what you want by attaching a whole disk to
the
guest, instead of just the partition.
Not possible in my situation - I want to be able to dual boot OR run Windows 7 as a guest using the same partition install.
I've often thought that it should be possible to cook something up
with
device manager -- essentially creating a "wrapper" that provides a
MBR,
etc. around a Windows logical volume or partition. Might be a fun project for someone.
I'm sure its possible to do that but it may require some hack of presenting a the original MBR as some type of shadow one for the guest or other trick. Ric, have you played w/ it?
Xen used to synthesize an MBR in the guest.
As Ian asked above, it's possible to do this with device-mapper too, although I doubt it's a good idea, but here's how you'd do it anyway:
https://lists.fedoraproject.org/pipermail/virt/2010-September/002288.html
https://rwmj.wordpress.com/2010/09/30/technique-for-synthesizing-a-partition...
So if I understand this correctly - it IS possible to (easily) do what I want with Xen but NOT kvm?
Thanks,
Phil.
On 01/05/2012 08:11 AM, Philip Rhoades wrote:
Rich,
On 2012-01-05 21:05, Richard W.M. Jones wrote:
On Thu, Jan 05, 2012 at 10:27:29AM +0200, Dor Laor wrote:
On 01/03/2012 06:42 PM, Ian Pilcher wrote:
On 01/02/2012 03:38 AM, Emanuel Rietveld wrote:
When you give qemu-kvm a partition to use as disk for a guest, it does exactly that. It uses the partition as a disk for the guest. So, the guest sees a *disk* while in the physical situation it's a
*partition*.
You may be able to do what you want by attaching a whole disk to the guest, instead of just the partition.
Not possible in my situation - I want to be able to dual boot OR run Windows 7 as a guest using the same partition install.
Won't work, in general, because your virtual machine will present different hardware to Windows than the native dual boot, and Windows is super-finicky about being booted on the same hardware every time.
So if I understand this correctly - it IS possible to (easily) do what I want with Xen but NOT kvm?
No. It's not possible to do what you want with either solution (at least, not possible while still being above the law with Microsoft product activation).
On Thu, Jan 05, 2012 at 10:07:31AM -0700, Eric Blake wrote:
On 01/05/2012 08:11 AM, Philip Rhoades wrote:
Rich,
On 2012-01-05 21:05, Richard W.M. Jones wrote:
On Thu, Jan 05, 2012 at 10:27:29AM +0200, Dor Laor wrote:
On 01/03/2012 06:42 PM, Ian Pilcher wrote:
On 01/02/2012 03:38 AM, Emanuel Rietveld wrote:
When you give qemu-kvm a partition to use as disk for a guest, it does exactly that. It uses the partition as a disk for the guest. So, the guest sees a *disk* while in the physical situation it's a
*partition*.
You may be able to do what you want by attaching a whole disk to the guest, instead of just the partition.
Not possible in my situation - I want to be able to dual boot OR run Windows 7 as a guest using the same partition install.
Won't work, in general, because your virtual machine will present different hardware to Windows than the native dual boot, and Windows is super-finicky about being booted on the same hardware every time.
Win7 is (relativelly) smart. It worked perfectly here a while ago using VirtualBox - and I have fancy hardware (it's a gaming machine). But you have to reactivate your windows everytime you switch, which is a PITA.
So if I understand this correctly - it IS possible to (easily) do what I want with Xen but NOT kvm?
No. It's not possible to do what you want with either solution (at least, not possible while still being above the law with Microsoft product activation).
I fail to see why it's ilegal (you are alowed to switch your machine keeping your win7 installation, you just can't have multiple installations). IANAL, though.
Cheers, - Ademar
On 01/09/2012 11:53 PM, Ademar de Souza Reis Jr. wrote:
On Thu, Jan 05, 2012 at 10:07:31AM -0700, Eric Blake wrote:
On 01/05/2012 08:11 AM, Philip Rhoades wrote:
Rich,
On 2012-01-05 21:05, Richard W.M. Jones wrote:
On Thu, Jan 05, 2012 at 10:27:29AM +0200, Dor Laor wrote:
On 01/03/2012 06:42 PM, Ian Pilcher wrote:
On 01/02/2012 03:38 AM, Emanuel Rietveld wrote: > When you give qemu-kvm a partition to use as disk for a guest, it does > exactly that. It uses the partition as a disk for the guest. So, the > guest sees a *disk* while in the physical situation it's a
*partition*.
> You may be able to do what you want by attaching a whole disk to the > guest, instead of just the partition.
Not possible in my situation - I want to be able to dual boot OR run Windows 7 as a guest using the same partition install.
Won't work, in general, because your virtual machine will present different hardware to Windows than the native dual boot, and Windows is super-finicky about being booted on the same hardware every time.
Win7 is (relativelly) smart. It worked perfectly here a while ago using VirtualBox - and I have fancy hardware (it's a gaming machine). But you have to reactivate your windows everytime you switch, which is a PITA.
So if I understand this correctly - it IS possible to (easily) do what I want with Xen but NOT kvm?
No. It's not possible to do what you want with either solution (at least, not possible while still being above the law with Microsoft product activation).
I fail to see why it's ilegal (you are alowed to switch your machine keeping your win7 installation, you just can't have
Various versions of windows, especially client based are licensed to run on physical but not virtual machines. A special license (or just the pro version) is required to run them as virtual.
Disclaim - I'm not a lawyer and never read more than 5% of any EULA..
multiple installations). IANAL, though.
Cheers, - Ademar
On Fri, Jan 06, 2012 at 02:11:44AM +1100, Philip Rhoades wrote:
Rich,
On 2012-01-05 21:05, Richard W.M. Jones wrote:
On Thu, Jan 05, 2012 at 10:27:29AM +0200, Dor Laor wrote:
On 01/03/2012 06:42 PM, Ian Pilcher wrote:
On 01/02/2012 03:38 AM, Emanuel Rietveld wrote:
When you give qemu-kvm a partition to use as disk for a guest,
it does
exactly that. It uses the partition as a disk for the guest.
So, the
guest sees a *disk* while in the physical situation it's a
*partition*.
You may be able to do what you want by attaching a whole disk
to the
guest, instead of just the partition.
Not possible in my situation - I want to be able to dual boot OR run Windows 7 as a guest using the same partition install.
You can use a small image with grub to boot the windows partition when running inside qemu. Basically a boot disk with grub pointing to your real partition as seen from qemu.
I had my win7 partition booting this way under VirtualBox. It was working perfectly (no hardware issues, win7 is smart enough regarding auto-detection). *BUT* everytime I switched between the VM and the real hardware, I had to reactivate my windows license (which is legal, but cumbersome).
I gave up on trying to fix the license reactivation (my win7 is for games anyway). But if you manage to mimic your hardware well enough inside qemu (lots of variables) or trick windows somehow (legal?), it should work. Please report your steps if you succeed.
Cheers, - Ademar
I've often thought that it should be possible to cook something
up with
device manager -- essentially creating a "wrapper" that
provides a MBR,
etc. around a Windows logical volume or partition. Might be a fun project for someone.
I'm sure its possible to do that but it may require some hack of presenting a the original MBR as some type of shadow one for the guest or other trick. Ric, have you played w/ it?
Xen used to synthesize an MBR in the guest.
As Ian asked above, it's possible to do this with device-mapper too, although I doubt it's a good idea, but here's how you'd do it anyway:
https://lists.fedoraproject.org/pipermail/virt/2010-September/002288.html
https://rwmj.wordpress.com/2010/09/30/technique-for-synthesizing-a-partition...
So if I understand this correctly - it IS possible to (easily) do what I want with Xen but NOT kvm?
Thanks,
Phil.
Philip Rhoades
GPO Box 3411 Sydney NSW 2001 Australia E-mail: phil@pricom.com.au _______________________________________________ virt mailing list virt@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/virt
Ademar,
On 2012-01-10 08:46, Ademar de Souza Reis Jr. wrote:
On Fri, Jan 06, 2012 at 02:11:44AM +1100, Philip Rhoades wrote:
Rich,
On 2012-01-05 21:05, Richard W.M. Jones wrote:
On Thu, Jan 05, 2012 at 10:27:29AM +0200, Dor Laor wrote:
On 01/03/2012 06:42 PM, Ian Pilcher wrote:
On 01/02/2012 03:38 AM, Emanuel Rietveld wrote:
When you give qemu-kvm a partition to use as disk for a guest,
it does
exactly that. It uses the partition as a disk for the guest.
So, the
guest sees a *disk* while in the physical situation it's a
*partition*.
You may be able to do what you want by attaching a whole disk
to the
guest, instead of just the partition.
Not possible in my situation - I want to be able to dual boot OR run Windows 7 as a guest using the same partition install.
You can use a small image with grub to boot the windows partition when running inside qemu. Basically a boot disk with grub pointing to your real partition as seen from qemu.
I had my win7 partition booting this way under VirtualBox. It was working perfectly (no hardware issues, win7 is smart enough regarding auto-detection). *BUT* everytime I switched between the VM and the real hardware, I had to reactivate my windows license (which is legal, but cumbersome).
I gave up on trying to fix the license reactivation (my win7 is for games anyway). But if you manage to mimic your hardware well enough inside qemu (lots of variables) or trick windows somehow (legal?), it should work. Please report your steps if you succeed.
I have been surviving quite happily without Windows for many years now but recently I have HAD to use it for only a couple of programs and I resent having to reboot for sometimes only 5mins a day - it would be excellent if I could get at the Win7 partition via a virtual arrangement but still have the dual boot option working OK if I need it . . the reactivation nonsense pisses me off . .
Thanks to all who posted! - it was much appreciated.
Regards,
Phil.
Ademar,
On 2012-01-10 08:46, Ademar de Souza Reis Jr. wrote:
On Fri, Jan 06, 2012 at 02:11:44AM +1100, Philip Rhoades wrote:
Rich,
On 2012-01-05 21:05, Richard W.M. Jones wrote:
On Thu, Jan 05, 2012 at 10:27:29AM +0200, Dor Laor wrote:
On 01/03/2012 06:42 PM, Ian Pilcher wrote:
On 01/02/2012 03:38 AM, Emanuel Rietveld wrote:
When you give qemu-kvm a partition to use as disk for a guest,
it does
exactly that. It uses the partition as a disk for the guest.
So, the
guest sees a *disk* while in the physical situation it's a
*partition*.
You may be able to do what you want by attaching a whole disk
to the
guest, instead of just the partition.
Not possible in my situation - I want to be able to dual boot OR run Windows 7 as a guest using the same partition install.
You can use a small image with grub to boot the windows partition when running inside qemu. Basically a boot disk with grub pointing to your real partition as seen from qemu.
Do you mean something like:
/dev/vda:
Number Start End Size File system Name Flags 1 1049kB 2097kB 1049kB bios_grub
/dev/sda:
1 2097kB 107MB 105MB ext4 ext4 boot 2 107MB 996GB 996GB ext4 3 996GB 1000GB 3950MB linux-swap(v1)
?
I had my win7 partition booting this way under VirtualBox. It was working perfectly (no hardware issues, win7 is smart enough regarding auto-detection). *BUT* everytime I switched between the VM and the real hardware, I had to reactivate my windows license (which is legal, but cumbersome).
If the hardware was 100% under a virtualised Win7 I guess I might never need to dual boot . .
I gave up on trying to fix the license reactivation (my win7 is for games anyway). But if you manage to mimic your hardware well enough inside qemu (lots of variables) or trick windows somehow (legal?), it should work. Please report your steps if you succeed.
I am tempted to give it a go . .
Thanks,
Phil.