推 virtuemood:原來如此,推你的實驗精神 04/06 01:05
※ 引述《pgychen (pp)》之銘言:
: 標題: [問題] boot physical disk windows in virtualbox
: 時間: Sat Apr 3 10:21:48 2010
: 請問在 linux host 之下,開啟實體硬碟上的 windows 時, MBR 扮演甚麼角色?
: 我們都知道 MBR 有 512bytes,其中前面 0~445 為啟動程式與資料
: 446~509 為 partition table,而這 partition table 共有 64 bytes
: 每 16 bytes 裡面記錄著一個 partition 的起始,結束磁柱等等資料
: 那要啟動實體硬碟上的 windows 時候,理論上,只要告訴他 partition number
: 他自己應該去讀磁碟機的 MBR,就可知道位置及大小在哪裡了,不是嗎?
: --
: ※ 發信站: 批踢踢實業坊(ptt.cc)
: ◆ From: 114.42.54.24
: → OrzOGC:建議你看一下VBOX的manual有超詳細說明. 04/03 11:06
: → OrzOGC:還有.用raw disk的方法並沒有比較快.就我測試過的結果來說. 04/03 11:08
: → virtuemood:我沒有遇到這種問題耶,授權過不了倒是有,見#16095 04/03 16:43
謝謝 OrzOGC 和 virtuemood
這幾天測試的結果,大概是:若 host 和 guest 在不同硬碟上,可不需要 mbr
若 host 和 guest 在同顆硬碟上,則需要 mbr,不是很確定的原因是:還是有些小問題。
不管同不同顆硬碟,因為要有讀寫的整顆硬碟的權限,才能創建 image 檔案,
若不能拿到整顆硬碟的權限,只有部分 partitions 可以有讀寫的權限,
可加入 -relative 參數,只要指定的 partitions 有讀寫權限即可。
以下是 virtualbox 手冊裡面提到的。
In some configurations it may be necessary to change the MBR code of the
created image, e.g. to replace the Linux boot loader that is used on the
host by another boot loader. This allows e.g. the guest to boot directly
to Windows, while the host boots Linux from the “same” disk. For this
purpose the -mbr parameter is provided. It specifies a file name from
which to take the MBR code. The partition table is not modified at all,
so a MBR file from a system with totally different partitioning can be
used. An example of this is
VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk
-rawdisk /dev/sda -partitions 1,5 -mbr winxp.mbr
The modified MBR will be stored inside the image, not on the host disk.
--------
另外,為什麼我要裝呢?
因為平日主要是在 linux 下工作,可是有時候,又需要 windows 環境,
這時候,開 virtualbox 下去跑 guest windows,又有點太慢,
所以想開原生 windows 環境。要開原生 windows 環境,就要安裝需要的軟體,
有些是 ISO 有些是早就下載好的,在 virtualbox 裡面,用 guest additions
就很方便地 載入進去,想到哪些,就安裝哪些,又快(已下載在 linux host)
又安全(用 linux NAT, 不需 windows 上網下載)
當然,也可以先都把需要的 cp 到隨身碟上面,但有時還是會 "落東落西"
所以用 virtualbox 還是比較方便。安裝好之後,就可以直接跑原生 windows,
下次還有需要的時候,再砍掉重練,還可以安裝較新版本的軟體。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.42.54.24