我已经设置了虚拟盒,以便能够使用我在硬盘上创建的分区进行启动。这不是虚拟驱动器。现在,在将 Linux Mint 安装到此分区之前,我想以不影响我的 Windows 启动的方式对其进行配置。我的意思是我不想看到启动选项屏幕或以任何方式减慢我的启动过程。但将 Linux 安装到实际分区很重要。这将允许稍后更轻松地捕获和将 VM 移动到硬盘,并且它还将使我的加密软件更好地工作。有什么办法可以做到这一点吗?
如果我已经设置了从分区启动的方式对此很重要,那么这就是我使用的方法。
2) Create the vmdk file:
2.1) Find the partitions that are used by your linux installation: start cmd as admin and cd into the directory you installed virtualbox and run:
C:\Program Files\Oracle\VirtualBox>VBoxManage.exe internalcommands listpartitions -rawdisk \\.\PhysicalDrive0
Oracle VM VirtualBox Command Line Management Interface Version 3.2.8
(C) 2005-2010 Oracle Corporation
All rights reserved.
Number Type StartCHS EndCHS Size (MiB) Start (Sect)
1 0x06 0 /1 /1 25 /254/63 203 63
2 0x07 26 /1 /40 1023/254/63 23999 417792
3 0x83 1023/254/63 1023/254/63 161242 49567744
5 0x07 1023/254/63 1023/254/63 42343 379792728
6 0x82 1023/254/63 1023/254/63 8635 466513920
PhysicalDrive0 indicates the first hard disk. Sort of like /dev/sda, /dev/sdb etc. Partition types 0×83 and 0×82 are the swap and ext3 partitions here.
From the listing identify all the partitions that are required by linux ( rootfs, swap, boot…)
Dont consider NTFS/VFAT partitions that you want to share between linux and windows.
2.2) Create the vmdk file with the partitions you just identified
VBoxManage.exe internalcommands createrawvmdk -filename C:\path\ubuntu.vmdk -rawdisk \\.\PhysicalDrive0 -partitions 3,6 -register
3) Start virtualbox. You have to start it as administrator, otherwise it wont be able to access the rawdisk.
4) Create a new VM using the vmdk you just created. This is a straightforward process. You would want to enable IO-APIC and if your box has muscle, allow more cores, 2d/3d acceleration etc.
5) And now, you’re all set. Start the VM. You should see the familiar grub boot screen. Select your ubuntu installation and it should come up without any issues.
答案1
我以为 vmdk 适用于 vmware(尽管在大多数情况下 virtualbox 可以使用它,但并非总是如此)。Virtualbox 确实支持原始磁盘:
http://www.virtualbox.org/manual/ch09.html#rawdisk
但是,这可能不是您想要的。根据我的经验,这样做不值得,因为性能提升微乎其微。对于 Linux,稍后为 v2p 或 v2v 添加磁盘要容易得多,只要目标位置的磁盘分区至少与您的虚拟机的大小相同即可。您总是需要稍后处理硬件差异。
另一件需要考虑的事情是,如果您想试验原始磁盘,只需使用 USB 外部磁盘/棒即可。