K
K
kyb2016-02-20 21:22:15
virtual box
kyb, 2016-02-20 21:22:15

How to make OS boot via VirtualBox or live (EFI)?

Macs have a cool feature. Once installed, Windows via bootcamp can be picked up by the Parallels virtual machine. This means that while sitting in the main OS, I can load Windows through a virtual machine, and if I need to give Windows full access to the hardware, for example, to a video card, in order to play fully, I run it through bootcamp.
I don't have a mac. I am using Ubuntu. And often Windows. The hardware configuration is high enough to run heavy Windows applications through VirtualBox from Ubuntu. However, maintaining two systems - one for live boot and one for virtual - is not convenient.
I am looking for ideas and solutions to implement the ability to run the same Windows both live and through a virtual machine. Of the possible tools, I assume VirtualBox, rEFInd (itself looks for all OSes with an efi bootloader).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kyb, 2016-02-21
@kyb

Praise be to all the gods, I did it!!! The dream came true.
I have Ubuntu and Windows 10 installed on the same physical disk. GPT partition table. Accordingly it is loaded through EFI. In theory, there will be no problems with the MBR. Total partitions 8, 1 efi, 1 ubuntu, 1 swap, 4 windows with their own recovery, 1 user.
So, we are already in Ubuntu (probably another debian-based also rolls), and the latest version of VirtualBox is installed. Then let's go.
We write a line in it KERNEL=="sdb", OWNER="user"or KERNEL=="sdb", GROUP="vboxusers". I chose to record the group, and added myself to it sudo adduser $USER vboxusers. Reboot. Checking

[email protected]:~$ ls -la /dev/sd*
    brw-rw---- 1 root disk      8,  0 Фев 21 01:57 /dev/sda
    brw-rw---- 1 root disk      8,  1 Фев 21 01:57 /dev/sda1
    brw-rw---- 1 root disk      8,  2 Фев 21 01:57 /dev/sda2
    brw-rw---- 1 root vboxusers 8, 16 Фев 21 02:25 /dev/sdb
    brw-rw---- 1 root disk      8, 17 Фев 21 01:57 /dev/sdb1
    brw-rw---- 1 root disk      8, 18 Фев 21 01:57 /dev/sdb2
    ...
spoiler
Это не очень правильно давать доступ на весь диск, особенно если на нём же стоит хост-система, но я так оно работает, иначе надо извращаться. позже. В [1] хорошо расписано, что касается MBR, до GPT, насколько я нагуглил/яндесил ещё не добрались.

Links: (many thanks to the authors for their help)
1. Working with RAW disks in VirtualBox . Recommended reading.
2. Add user to existing Group I
also recommend:
1. rEFInd - a super program that runs after EFI and searches for all EFI-compatible systems on all disks. Understands video and Linux. With it, it is not necessary to register the OS (efi files) in the efi section. Installation in 4 commands from under linux.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question