磁盘启动VMLite VBoot.docx

上传人:b****8 文档编号:9674601 上传时间:2023-05-20 格式:DOCX 页数:13 大小:23.78KB
下载 相关 举报
磁盘启动VMLite VBoot.docx_第1页
第1页 / 共13页
磁盘启动VMLite VBoot.docx_第2页
第2页 / 共13页
磁盘启动VMLite VBoot.docx_第3页
第3页 / 共13页
磁盘启动VMLite VBoot.docx_第4页
第4页 / 共13页
磁盘启动VMLite VBoot.docx_第5页
第5页 / 共13页
磁盘启动VMLite VBoot.docx_第6页
第6页 / 共13页
磁盘启动VMLite VBoot.docx_第7页
第7页 / 共13页
磁盘启动VMLite VBoot.docx_第8页
第8页 / 共13页
磁盘启动VMLite VBoot.docx_第9页
第9页 / 共13页
磁盘启动VMLite VBoot.docx_第10页
第10页 / 共13页
磁盘启动VMLite VBoot.docx_第11页
第11页 / 共13页
磁盘启动VMLite VBoot.docx_第12页
第12页 / 共13页
磁盘启动VMLite VBoot.docx_第13页
第13页 / 共13页
亲,该文档总共13页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

磁盘启动VMLite VBoot.docx

《磁盘启动VMLite VBoot.docx》由会员分享,可在线阅读,更多相关《磁盘启动VMLite VBoot.docx(13页珍藏版)》请在冰点文库上搜索。

磁盘启动VMLite VBoot.docx

磁盘启动VMLiteVBoot

VMLiteVBoot-LinuxVHDBoot

点击转到译文

Copyright©2010,VMLiteInc.

1Overview

1.1LinuxasRealAppliance

WithVBootforLinux,youcanpre-installandpre-configureLinuxOSanditsapplications,thendistributetheresultingvirtualdiskfileinVHDformat.Thevhdcanbootarealcomputer,withconfigurationandappsinstantlyavailable.Thisway,operatingsystemsaretrulymanageable,assimpleasfiles.WecallsuchaLinuxVHDtobearealappliance,inthesensethatitbootsphysicalcomputers.

It'sveryeasytosetupandbootacomputerwithavhdfile.Youdownloadthevhdfile,dropittoWindowsorLinuxfilesystem,thenconfigurethebootloader,andrebootthecomputer.

1.2LinuxasVirtualAppliance

Theexactsamevhdfilealsorunsasavirtualmachineusingvirtualizationsoftware,suchasVMLiteWorkstation,VirtualBox,XenandVirtualPCandHyper-V,etc.Bydefault,it'soptimizedforVMLiteWorkstation.

IfVMLiteWorkstationisinstalled,youcansimplydoubleclicktheubuntu-1004-desktop-i386.mopfiletolaunchthevhdasavirtualmachinewithVMLiteWorkstation.

1.3USBBootMadeEas

Youjustneedtostorethevhdfiletousbdrive,thenhooktheUSBtodifferentcomputerstoboot.IfyourcomputerBIOSdoesnotsupportUSBboot,youneedtoconfigureGRUB2tosupportUSB.

1.4ThesampleUbuntuVHD

Thesample ubuntu-1004-desktop-i386.vhdisapre-installed32-bitUbuntu9.10desktopversioninEnglish.

∙selfgrowingdiskwithdiskcapacityof100G,withinitialsizeabout3G

∙rootusername/password:

user/welcome

2SystemRequirements

∙Windows2000andLater,32-and64-bit,NTFSfilesystemGRUB2orothercompatiblebootloaders,32-and64-bit

∙Mac-tobesupportedsoon

∙4Gdiskspace

3DownloadandExtract

ThesampleUbuntu9.10packageisafewhundredMB,soitwilltakequitesometimetodownload,andit'srecommendedtouseadownloadmanager,suchasFlashGet.

Oncedownloadiscomplete,firstyouneedtoextractthefile,whichisin.7zformat.Moreinfocanbefoundathttp:

//www.7-zip.org/download.html.OnWindows,youcanuseWinRaror7Ziptoextractthefile.OnLinux,youcanusethefollowingcommandstoinstall7zip,andunzipthefile:

   sudoapt-getinstallp7zip

   p7zip-dubuntu-1004.7z

Inordertobootacomputerusingthevhdfile,makesurethatit'snotextractedtoanetworkdrive,ortoanothervirtualdisk.Thevhdfilemustresideinabasicvolumeoninternalorexternalharddisks(e.g.,USBdrives),otherwise,itwon'tboot.

4InstallonWindows

IfyourcurrenthostisWindows,youneedtoinstallVBootloader,andaddabootentrytoWindowsbootmanager.Inaddition,youneedtotellVBootwheretofindthevhdfile.

4.1AutomaticSetupbyrunningsetup.exe

It'shighlyrecommendthatyouusethismethodtosetupVBootonWindows,sinceit'sextremelysimpleandautomateseverything.Yousimplydoubleclicksetup.exeon32-bitWindows,orsetup64.exeon64-bitWindows.ThesetuputilitywillinstallVBootLoader,andconfiguretheWindowsbootloadertocontainanentrytoboottheLinuxVHD.

Aftersetup.exeissuccessfullyrun,yourebootthecomputer,andyoushouldseea"VBoot-UbuntuVHDBoot"entryasthelastone,selectthisentrytoboottoLinux.

4.2ManualSetup

Ifsomehowtheautomaticsetupdoesn'twork,thenyoucanperformthefollowingmanualsteps:

4.2.1CopyVBootLoaderFiles

TheVBootloaderisbasedonGNUGRUB2,anditsfilesarelocatedinvbootsubdirectory.

∙vbootldr.mbrandvbootldrarethetwocriticalbootloaderfilesthatmustbecopiedtotherootdirectoryofadrive,typicalC:

\.

∙Thefontsdirectorycontainsfontfilestobeusedbyourbootloader.

∙Thegrubdirectorycontainsgrub2modules,andtheveryimportgrub.cfgconfigurationfile.

Forexample,ifyouwanttocopythefilestoC:

\,youneedtocopythevbootdirectorytoc:

\,soyouwillhavec:

\vbootdirectory.Thenyoumustcopyvbootldr.mbrandvbootldrtoc:

\.

Thefollowingcommandscanbeusedtocopythefiles.Makesuretorunfromtheextracteddir.

mdc:

\vboot

xcopy/svbootc:

\vboot

copyvboot\vbootldrc:

\

copyvboot\vbootldr.mbrc:

\

4.2.2Configuregrub.cfg

Asamplegrub.cfgfileisplacedinc:

\vboot\grubdirectory(ord:

\vboot\grubdependingonwhereyouhavecopiedthefiles).ThisistheGRUB2configuratrionfiletoloadoperatingsystems.Insidethisfile,thevhdfilepathishardcoded,andthusyouhavetomodifyit.

grub.cfgisatextfilethatyoucanusenotepadtoopenandmodify.Therelevantportionisshownbelow:

menuentry"VHDUbuntu,Linux2.6.32-21-generic"{

insmodvhd

vhdvhd0(hd0,1)/ubuntu-1004/ubuntu-1004-desktop-i386.vhd--partitions

linux(vhd0,1)/boot/vmlinuz-2.6.32-21-genericroot=/dev/sda1vloop=/ubuntu-1004/ubuntu-1004-desktop-i386.vhdquietsplash

initrd(vhd0,1)/boot/initrd.img-2.6.32-21-generic

}

menuentrygroupsaspecificoperatingsystem.Thefirstlineinsmodvhdinsertsourvhd.modmoduletothebootloader.vhd.modisaGRUB2modulethattreatsavhdfileasharddisk,andallowsGRUB2toreadfilesfromthevhd.Forexample,theLinuxkernelandinitrdareloadedfromthevhdfile,asconfiguredabove.

Therearethreepaths(asshowninred)relatedtothevhdfilethatyouneedtochangedependingonthedirectorytowhichthevhdfileisextracted.

Thevhdpath(hd0,1)/ubuntu-1004/ubuntu-1004-desktop-i386.vhdisinGRUB2formatwhere(hd0,1)indicatesharddisk0andpartition1,withtherestistheabsolutepathinUNIXformat.Forexample,ifyourvhdfileisinsideafoldercalled123onanexternalUSBdisk,thenyouneedtochangethispathtosomethinglike(hd1,1)/123/ubuntu-1004-desktop-i386.vhd.Thepathimmediatelyaftervloop=shouldbethesameabsolutepathwithoutthedisknumberandpartitionnumber.

TherootpathistheLinuxdevicenameforthediskwherethevhdfileresides.Thenumberisthepartitionnumber,andtheletter'a','b','c',etc,representswhichdisk.For(hd0,1),thenamewouldbe/dev/sda1;For(hd1,1), itwouldbe/dev/sdb1;For(hd2,4),itwouldbe/dev/sdc4,etc.

44.2.3ConfigureWindowsBootLoader

OnceVBootLoaderandthevhdfileareready,youneedtoconfigureWindowsbootmanager,soyoucanboottotheLinuxVHD.Youneedtoappendthevbootldr.mbrentrytothe[operatingsystems]section.Thefollowingissampleboot.inifilewithVBootentryaddedattheverylast.Showninrediswhatyouneedtoaddtoboot.ini.ChangeC:

towhateverdriveyouhavecopiedVBootLoaderfiles.

[bootloader]

timeout=30

default=multi(0)disk(0)rdisk(0)partition

(1)\WINDOWS

[operatingsystems]

multi(0)disk(0)rdisk(0)partition

(1)\WINDOWS="MicrosoftWindowsXPProfessional"/noexecute=optin/fastdetect

C:

\vbootldr.mbr="VBoot-UbuntuVHDBoot"

4.2.3.2WindowsVista/2008/7

WindowsVistaandaboveuseadifferentmechanismotherthanboot.inittoboot,andyouneedtorunbcdedit.exetomakechangestothebootmanager.ThefollowingarethecommandstorunifyouhavecopiedVBootLoadertodriveC:

. YoumustrumthesecommandsasAdministrator.GotoWindowsStartmenu>AllPrograms>Accessories,thenrightclickon"CommandPrompt",thenselect"RunAsAdministrator".Oncecommandpromptwindowisopen,youcanenterthesecommands.

bcdedit/create{D3DCE997-7447-41FC-9740-A8D20EE3BF55}/d"UbuntuVHDBoot"/applicationBOOTSECTOR

bcdedit/set{D3DCE997-7447-41FC-9740-A8D20EE3BF55}devicepartition=C:

bcdedit/set{D3DCE997-7447-41FC-9740-A8D20EE3BF55}path\vbootldr.mbr

bcdedit/displayorder{D3DCE997-7447-41FC-9740-A8D20EE3BF55}/addlast

bcdedit/timeout30

5InstallonLinux

OnLinuxsystems,thereisnoneedtoinstallVBootLoader.Instead,youonlyneedtoaddanentrytoyourcurrentbootloadersotheLinuxVHDcanbebooted.

5.1ConfigureGRUB2

YoucanedittheGRUB2configfile,/boot/grub/grub.cfg,usinganytexteditor,andinsertanentrylikethefollowing:

menuentry"VHDUbuntu,Linux2.6.32-21-generic"{

linux(hd0,1)/ubuntu-1004/vmlinuz-2.6.32-21-genericroot=/dev/sda1vloop=/ubuntu-1004/ubuntu-1004-desktop-i386.vhdvlooppart=p1quietsplash

initrd(hd0,1)/ubuntu-1004/initrd.img-2.6.32-21-generic

}

TherearesomesubtledifferencesbetweenLinuxandWindowshost.OnWindowswhereourGRUB2module,vhd.mod,isavailable,youcanconfigureGRUB2toloadtheLinuxkerenlandinitrdfromtheexactlysamevhdfile,whereasonLinuxsystems,thekernelandinitrdareseparatefilesresidingexternally.Inotherwords,onWindows,it'sstrictlyonlyonevhdfileisrequired;whereasonLinux,3files(kernel,initrd,vhd)arerequired.Wewilltrytomakethevhd.modmoduletosupportLinuxfilesystemsoon.

Obviously,youneedtochangethepathsdependingonthedirectorytowhichthekernel,initrdandvhdfilesareextracted.

Thepath(hd0,1)indicatesharddisk0andpartition1,withtherestistheabsolutepathinUNIXformat.Forexample,ifyourvhdfileisinsideafoldercalled123onanexternalUSBdisk,thenyouneedtochangethispathtosomethinglike(hd1,1)/123/ubuntu-1004-desktop-i386.vhd.Thepathimmediatelyaftervloop=shouldbethesameabsolutepathwithoutthedisknumberandpartitionnumber.

TherootpathistheLinuxdevicenameforthediskwherethevhdfileresides.Thenumberisthepartitionnumber,andtheletter'a','b','c',etc,representswhichdisk.For(hd0,1),thenamewouldbe/dev/sda1;For(hd1,1), itwouldbe/dev/sdb1;For(hd2,4),itwouldbe/dev/sdc4,etc.

5.3ConfigureLegacyGRUB

ForGRUB0.97andsimilar,youcanaddanentrytoyourGRUBconfigfile,/boot/grub/menu.lst,usinganytexteditor,andinsertanentrylikethefollowing:

titleVBoot-UbuntuVHDBoot

kernel/boot/ubuntu-1004/vmlinuz-2.6.32-21-genericroot=/dev/sda1vloop=/boot/ubuntu-1004/ubuntu-1004-desktop

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 解决方案 > 学习计划

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2