LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 11-03-2016, 01:27 PM   #1
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
Windows 7 Pro 64-bit guest using raw disk and EFI


Is there a way to run Windows 7 Pro 64-bit EFI system in a VM with raw disk access?

Reading around the web indicates running Windows 7 in VirtualBox with EFI is not supported. This bug report and this discussion seem to affirm my findings.

Do any of the other virtualization platforms support this kind of configuration?

Thanks for any ideas.

Background:

I am helping a person configure and learn CentOS 7 on a new laptop. The laptop came with Windows 7 Professional 64-bit pre-installed. The laptop uses EFI.

This person is dependent on certain Windows vertical apps and currently is dual booting. This person would like to stop dual booting by running Windows 7 Pro inside a VM using raw disk access.

I have used VirtualBox raw disk access several times with no problems.

The difference this time is EFI. All of my past efforts with raw disk access were with BIOS/MBR systems. This project is my first exposure to using EFI in VirtualBox.

Perhaps VirtualBox is not a sane approach in this particular use case.

Converting Windows 7 to virtual (P2V) might be possible but not reasonable. Too much data to convert as well as the usual problems with Windows partition management and reactivation.

Possibly we could configure the EFI to use CSM and an MBR, but I need some tutorials to proceed further.
 
Old 11-03-2016, 03:00 PM   #2
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
KVM/qemu can run 64 bit Win 7 in (U)EFI with raw disk access, or, in fact, any kind of disk access. There's any number of tutorials available, wth an active mailing list. Check out vfio.blogspot.com
 
Old 11-03-2016, 04:35 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,978

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Two issues really. Can a VM run a physical drive and two can Windows HAL allow it. (maybe a legal issue with this)

Almost all VM's can run a physical drive by some means. It is not a recommended way.
Booting to a usb would prevent disk access issues. Guess one could boot directly to a linux partition and then run the original windows partition. Not sure how well that would work exactly. I've done it with limited success.

Now the second part may be how what I assume would be windows OEM being tied to the hardware. I think I've run into issues here. Once you fix hal or if it can fix hal then the actual install will be also changed and to boot again you'd need to fix hal back.

Try the programs in wine or maybe ReactOS or just use dual boot might end up being the solution.
 
Old 11-04-2016, 05:50 PM   #4
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
I ran a quick test of EFI support in VirtualBox with Windows 7. When using EFI in VirtualBox, Windows 7 32-bit does not install at all. VirtualBox simply dumps into an EFI shell. I think the reason is Windows 7 32-bit does not support EFI, but I am guessing. Windows 7 64-bit starts to install and then freezes. So that nominal effort more or less affirms that Windows 7 is not supported in VirtualBox with EFI.

Windows 10 installs just fine when using EFI in VirtualBox.

I am presuming KVM/QEMU uses OVMF for the EFI emulation layer. I would guess the VirtualBox devs use the same code in VirtualBox. So I do not know why KVM/QEMU supports Windows 7 and VirtualBox does not.

@mostlyharmless: This is encouraging to read. Sadly, I am familiar only with VirtualBox. Learning KVM/QEMU has been on my to-do list for some time. Looks like I should bump that item higher on my list.

I looked at vfio.blogspot.com. At the moment everything written there is over my head. I need to read some tutorials that are written at the baby step level. Something that provides a good "block diagram" and flowchart overview of the KVM/QEMU/CentOS tool chain and required packages. If possible at your end I would appreciate some links to get me started at that beginner level.

@jefro: I have used raw disk access several times, including three current systems. I never read anything about the approach being not recommended. I have read that concurrent access of the affected partitions from both the host and guest is likely to corrupt data. I avoid concurrent access by creating udev rules to ignore the Windows partitions. That way the partitions are not listed in file managers and then are not easily inadvertently mounted while running the VM with raw partition access.

Regard OEMs, VirtualBox supports spoofing firmware data. A few years ago I created a script that uses dmidecode to grab BIOS and SLIC information. The script grabs the actual eth0 MAC address. The MAC address seems to be a heavily weighted attribute of the [re]activation scheme. The script then creates another one-shot script that I use to populate the VirtualBox config file with the extra data. The extra data seems to avoid needing to reactivate.

Once the VM is functional using raw disk access and firmware spoofing, I then remove boot access from the GRUB boot loader. Basically I disable dual booting. That way there never is a conflict with physical and virtual hardware detection that triggers reactivation.

The stumbling block this time is I never worked with EFI in VirtualBox. I simply do not have any such hardware.

WINE will not help with this person's Windows needs. He is running special vertical apps related to his business. Neither of us have time nor the energy to tinker with WINE. ReactOS is a non conversation.
 
Old 11-04-2016, 07:22 PM   #5
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
Maybe it would be easier to use MS Virtual PC and run Centos in the VM, leaving windows 7 as is.
 
Old 11-04-2016, 09:26 PM   #6
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
Quote:
Maybe it would be easier to use MS Virtual PC and run Centos in the VM, leaving windows 7 as is.
Yes, but ....

The user wants to start migrating away from Windows. While he has certain Windows vertical app dependencies, he is looking long term and wants to migrate. He uses CentOS 6 in almost all of his servers. His first choice for his first desktop migration was CentOS 7. He is content with the MATE Desktop because of the familiarity with GNOME 2 in CentOS 6.

Outside his vertical dependencies, he wants to move forward. He does not want to move to Windows 10 and the clock is ticking slowly toward EOL for Windows 7. The proverbial handwriting is on the wall with respect to Windows 7. Three years until EOL provides him plenty of time to migrate, acclimate, and decide what to do about the Windows dependencies.

Interestingly, he has a low opinion of Windows because of the way everything is masked and hidden from the user, making debugging and troubleshooting difficult. He is not tickled at the way Windows 10 is designed or the way the MS folks are moving forward.

He is no hurry to migrate and is prepared to tackle each challenge along the way. Because I had created several VirtualBox VMs using raw disk access, we both thought we could do likewise on his new laptop. I never thought about EFI. As Windows 10 seems well supported in VirtualBox with EFI, all we can do is shrug and frown that Windows 7 lacks the same support. Reading the bug report I linked in the original post indicates this is not a high priority for the VirtualBox devs. C'est la vie.

So now we move forward looking at other virtualization options. For some time I have been wanting to learn more about KVM/QEMU and the libvirt/virt-manager platform. Looks like something to do this winter.

If you are curious, one of the dependencies is Quickbooks, which is dependent on Intuit cloud servers. He fully understands his lock-in. He also uses some networking tools that only run in Windows. We might find work-arounds for the networking tools, but QuickBooks is a tight and mean vendor lock-in challenge.
 
Old 11-04-2016, 09:50 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,978

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
I have a small efi computer that as I recall has a way to load windows 7 to eif. Forget how to do that.
 
Old 11-04-2016, 10:02 PM   #8
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, EndeavourOS, OpenSUSE, KDE Neon
Posts: 4,005
Blog Entries: 26

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
Quote:
Originally Posted by jefro View Post
I have a small efi computer that as I recall has a way to load windows 7 to eif. Forget how to do that.
I have managed to get 7 installed on uefi before, although I don't remember how to do so either as it's been a while since I tried (and it was a lot of frustration getting it to work.
 
Old 11-04-2016, 10:30 PM   #9
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
The problem in this use case is VirtualBox.

The problem is not installing Windows 7 in hardware with EFI. The laptop came with Windows 7 Pro 64-bit preinstalled.

There was no problem installing CentOS 7 on the laptop and dual booting with GRUB.

The problem is VirtualBox does not support Windows 7 using its own EFI support layer emulation.

I have used raw disk access several times to avoid dual booting. Every time the VM was not using the VirtualBox EFI support emulation. My past projects all used traditional BIOS emulation.

This lack of support is evident to me when I tried to install Windows 7 32-bit and 64-bit inside a VirtualBox VM with the EFI support enabled. I was unable to install. Disabling the EFI support emulation results in Windows 7 installing in the VM without incident.

That all said, possibly there is a unique way to configure VirtualBox. That is why I started this thread. Yet the links in the original post indicate Windows 7 is not supported in VirtualBox when using EFI emulation.

Right now the user has to dual boot. Doable and livable, but not efficient or ideal.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
boot efi disk with without a non-efi bios pc... masavini Programming 1 11-12-2013 08:48 PM
EFI main GPT overwritten everytime (when windows 7 runs) - structure of EFI masuch Linux - Newbie 2 07-20-2012 02:49 PM
Is there a way to Testing the Host Os inside the guest pc safely?(raw disk access). frog-o Linux - Virtualization and Cloud 1 05-28-2011 03:34 PM
Disk Partitions for dual boot with Windows 7 GPT/EFI motiv8d1 Linux - General 2 01-10-2011 06:22 PM
VirtualBox Raw Access, Windows Host, Linux Guest Guitarist88 Linux - Newbie 2 11-14-2008 04:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 10:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration