Mac OS X下VirtualBox如何对硬盘进行扩容

来源:互联网 发布:网络维保服务 编辑:程序博客网 时间:2024/06/14 10:22
当初在Mac上装虚拟机时,没想到win7会吃那么多空间,预留的25GB空间很快就被系统吃完了,后来加了一个虚拟盘,把一些软件以及系统的缓存文件搬迁到了D盘,但是系统盘C盘依旧还是不断的吃紧,没辙,还是想办法扩容吧。

由于VirtualBox不像VM那样提供便捷的硬盘扩容界面,所以我们只能手工命令操作去扩容了。

开始着手准备:

1.找到VBoxManager工具
1)打开Finder,找到【应用程序】,在右侧找到VirtualBox.app,然后打开右键,找到【显示包内容】,点击打开
Mac <wbr>OS <wbr>X下VirtualBox如何对硬盘进行扩容
2)看到目录就一路点下去,然后看到这个【MacOS】目录,再继续点
Mac <wbr>OS <wbr>X下VirtualBox如何对硬盘进行扩容
3)看到我们的目标文件VBoxManager文件没?
Mac <wbr>OS <wbr>X下VirtualBox如何对硬盘进行扩容
记住这个路径

2.打开终端,来到这个目录下

cd /Applications/VirtualBox.app/Contents/MacOS/

3.查看VBoxManager怎么用(觉的头晕的同学,可以直接跳往第四点 go>>>):D

VBoxManage -h

Oracle VM VirtualBox Command Line Management InterfaceVersion 4.3.30

(C) 2005-2015 Oracle Corporation

All rights reserved.

Usage:

  VBoxManage []

General Options:

  [-v|--version]          print version number andexit

  [-q|--nologo]           suppress the logo

  [--settingspw ]      provide the settingspassword

  [--settingspwfile ] provide a filecontaining the settings password

Commands:

  list [--long|-l]       vms|runningvms|ostypes|hostdvds|hostfloppies|

                       intnets|bridgedifs|hostonlyifs|natnets|dhcpservers|

                       hostinfo|hostcpuids|hddbackends|hdds|dvds|floppies|

                       usbhost|usbfilters|systemproperties|extpacks|

                        groups|webcams

  showvminfo             [--details]

                       [--machinereadable]

  showvminfo             --log

  registervm            

  unregistervm           [--delete]

  createvm               --name

                        [--groups , ...]

                        [--ostype ]

                        [--register]

                        [--basefolder ]

                        [--uuid ]

  modifyvm              

                        [--name ]

                        [--groups , ...]

                        [--description ]

                        [--ostype ]

                        [--iconfile ]

                        [--memory ]

                        [--pagefusionon|off]

                        [--vram ]

                        [--acpi on|off]

                        [--pciattach03:04.0]

                        [--pciattach03:04.0@02:01.0]

                        [--pcidetach03:04.0]

                        [--ioapic on|off]

                        [--hpet on|off]

                        [--triplefaultreseton|off]

                        [--hwvirtexon|off]

                        [--nestedpagingon|off]

                        [--largepageson|off]

                        [--vtxvpid on|off]

                        [--vtxux on|off]

                        [--pae on|off]

                        [--longmodeon|off]

                        [--synthcpuon|off]

                        [--cpuidset ]

                        [--cpuidremove ]

                        [--cpuidremoveall]

                        [--hardwareuuid ]

                        [--cpus ]

                        [--cpuhotplugon|off]

                        [--plugcpu ]

                        [--unplugcpu ]

                        [--cpuexecutioncap<1-100>]

                        [--rtcuseutcon|off]

                        [--graphicscontrollernone|vboxvga|vmsvga]

                        [--monitorcount ]

                        [--accelerate3don|off]

                        [--accelerate2dvideoon|off]

                        [--firmwarebios|efi|efi32|efi64]

                        [--chipsetich9|piix3]

                        [--bioslogofadeinon|off]

                        [--bioslogofadeouton|off]

                        [--bioslogodisplaytime]

                        [--bioslogoimagepath]

                        [--biosbootmenudisabled|menuonly|messageandmenu]

                        [--biossystemtimeoffset]

                        [--biospxedebugon|off]

                        [--boot<1-4>none|floppy|dvd|disk|net>]

                        [--nic<1-N>none|null|nat|bridged|intnet|hostonly|

                                 generic|natnetwork]

                        [--nictype<1-N>Am79C970A|Am79C973|

                                     82540EM|82543GC|82545EM|

                                     virtio]

                        [--cableconnected<1-N>on|off]

                        [--nictrace<1-N>on|off]

                        [--nictracefile<1-N>]

                        [--nicproperty<1-N>name=[value]]

                        [--nicspeed<1-N>]

                        [--nicbootprio<1-N>]

                        [--nicpromisc<1-N>deny|allow-vms|allow-all]

                       [--nicbandwidthgroup<1-N> none|]

                        [--bridgeadapter<1-N>none|]

                        [--hostonlyadapter<1-N>none|]

                        [--intnet<1-N>]

                        [--nat-network<1-N>]

                       [--nicgenericdrv<1-N>

                        [--natnet<1-N>|default]

                        [--natsettings<1-N>[],[],

                                        [],[],

                                        []]

                        [--natpf<1-N>[],tcp|udp,[],

                                   ,[],]

                        [--natpf<1-N> delete]

                        [--nattftpprefix<1-N>]

                        [--nattftpfile<1-N>]

                        [--nattftpserver<1-N>]

                       [--natbindip<1-N>

                       [--natdnspassdomain<1-N> on|off]

                        [--natdnsproxy<1-N>on|off]

                       [--natdnshostresolver<1-N> on|off]

                        [--nataliasmode<1-N>default|[log],[proxyonly],

                                                [sameports]]

                        [--macaddress<1-N>auto|]

                        [--mouseps2|usb|usbtablet|usbmultitouch]

                        [--keyboardps2|usb

                        [--uart<1-N> off|]

                        [--uartmode<1-N>disconnected|

                                      server |

                                      client |

                                      file |

                                      ]

                        [--guestmemoryballoon]

                        [--audionone|null|coreaudio]

                        [--audiocontrollerac97|hda|sb16]

                        [--clipboarddisabled|hosttoguest|guesttohost|

                                  bidirectional]

                        [--draganddropdisabled|hosttoguest

                        [--vrde on|off]

                        [--vrdeextpackdefault|

                        [--vrdeproperty ]

                        [--vrdeport ]

                        [--vrdeaddress ]

                        [--vrdeauthtypenull|external|guest]

                        [--vrdeauthlibrarydefault|

                        [--vrdemulticonon|off]

                        [--vrdereuseconon|off]

                        [--vrdevideochannelon|off]

                        [--vrdevideochannelquality]

                        [--usb on|off]

                        [--usbehci on|off]

                        [--snapshotfolderdefault|]

                        [--teleporteron|off]

                        [--teleporterport]

                       [--teleporteraddress



                        [--teleporterpassword]

                        [--teleporterpasswordfile|stdin]

                        [--tracing-enabledon|off]

                        [--tracing-config]

                        [--tracing-allow-vm-accesson|off]

                        [--usbcardreaderon|off]

                        [--autostart-enabledon|off]

                        [--autostart-delay]

                        [--vcpenabledon|off]

                        [--vcpscreens[],...

                        [--vcpfile ]

                        [--vcpwidth ]

                        [--vcpheight ]

                        [--vcprate ]

                        [--vcpfps ]

                        [--defaultfrontenddefault|]

  clonevm               

                        [--snapshot |]

                        [--modemachine|machineandchildren|all]

                        [--optionslink|keepallmacs|keepnatmacs|

                                 keepdisknames]

                        [--name ]

                        [--groups , ...]

                        [--basefolder ]

                        [--uuid ]

                        [--register]

  import                

                        [--dry-run|-n]

                        [--optionskeepallmacs|keepnatmacs]

                        [more options]

                        (run with -n to have optionsdisplayed

                         for aparticular OVF)

  export                --output|-o .

                       [--legacy09|--ovf09|--ovf10|--ovf20]

                        [--manifest]

                        [--iso]

                        [--optionsmanifest|iso|nomacs|nomacsbutnat]

                        [--vsys ]

                               [--product]

                              [--producturl ]

                               [--vendor]

                              [--vendorurl ]

                               [--version]

                              [--description ]

                               [--eula]

                              [--eulafile ]

  startvm                ...

                        [--typegui|headless]

  controlvm             

                       pause|resume|reset|poweroff|savestate|

                       acpipowerbutton|acpisleepbutton|

                        keyboardputscancode [...]|

                        setlinkstate<1-N>on|off |

                        nic<1-N>null|nat|bridged|intnet|hostonly|generic|

                               natnetwork [] |

                        nictrace<1-N> on|off|

                        nictracefile<1-N>|

                        nicproperty<1-N>name=[value] |

                        nicpromisc<1-N>deny|allow-vms|allow-all |

                        natpf<1-N>[],tcp|udp,[],

                                  ,[], |

                        natpf<1-N> delete|

                        guestmemoryballoon|

                        usbattach |

|

                        usbdetach |

|

                        clipboarddisabled|hosttoguest|guesttohost|

                                bidirectional |

                        draganddropdisabled|hosttoguest |

                        vrde on|off |

                        vrdeport |

                        vrdeproperty |

                        vrdevideochannelquality|

                        setvideomodehint

                                     [[] [ |

                                       [ ]]] |

                        screenshotpng [display]|

                        vcpenabled on|off|

                        vcpscreens all|none|,[...]|

                        setcredentials

                                    --passwordfile |

                                   

                                    [--allowlocallogon ] |

                        teleport --host--port

                               [--maxdowntime ]

                               [--passwordfile |

                                --password ] |

                        plugcpu |

                        unplugcpu |

                        cpuexecutioncap<1-100>

                        webcam | |

  discardstate           

  adoptstate            

  snapshot              

                        take [--description ][--live] |

                        delete |

                        restore |

                        restorecurrent |

                        edit |--current

                            [--name ]

                            [--description ] |

                        list[--details|--machinereadable]

                        showvminfo

  closemedium            disk|dvd|floppy

                        [--delete]

  storageattach          

                        --storagectl

                        [--port ]

                        [--device ]

                        [--typedvddrive|hdd|fdd]

                        [--mediumnone|emptydrive|additions|

                                |host:|iscsi]

                        [--mtypenormal|writethrough|immutable|shareable|

                               readonly|multiattach]

                        [--comment ]

                        [--setuuid ]

                        [--setparentuuid ]

                        [--passthroughon|off]

                        [--tempejecton|off]

                        [--nonrotationalon|off]

                        [--discard on|off]

                        [--bandwidthgroup]

                        [--forceunmount]

                        [--server |]

                        [--target ]

                        [--tport ]

                        [--lun ]

                        [--encodedlun ]

                        [--username ]

                        [--password ]

                        [--initiator ]

                        [--intnet]

  storagectl            

                        --name

                        [--addide|sata|scsi|floppy|sas]

                        [--controllerLSILogic|LSILogicSAS|BusLogic|

                                   IntelAHCI|PIIX3|PIIX4|ICH6|I82078]

                        [--portcount<1-30>]

                        [--hostiocacheon|off]

                        [--bootableon|off]

                        [--remove]

  bandwidthctl           

                        add --typedisk|network

                           --limit [k|m|g|K|M|G] |

                        set

                           --limit [k|m|g|K|M|G] |

                        remove |

                        list[--machinereadable]

                        (limit units: k=kilobit,m=megabit, g=gigabit,

                                   K=kilobyte, M=megabyte, G=gigabyte)

  showhdinfo            

  createhd               --filename

                        [--size |--sizebyte]

                        [--diffparent |

                        [--format VDI|VMDK|VHD](default: VDI)

                        [--variantStandard,Fixed,Split2G,Stream,ESX]

  modifyhd              

                        [--typenormal|writethrough|immutable|shareable|

                              readonly|multiattach]

                        [--autoreseton|off]

                        [--property ]

                        [--compact]

                        [--resize |--resizebyte]

  clonehd               

                        [--formatVDI|VMDK|VHD|RAW|]

                        [--variantStandard,Fixed,Split2G,Stream,ESX]

                        [--existing]

  convertfromraw         

                        [--formatVDI|VMDK|VHD]

                        [--variantStandard,Fixed,Split2G,Stream,ESX]

                        [--uuid ]

  convertfromraw          stdin

                        [--formatVDI|VMDK|VHD]

                        [--variantStandard,Fixed,Split2G,Stream,ESX]

                        [--uuid ]

  getextradata           global|

                        |enumerate

  setextradata           global|

                       

                        [] (no value deleteskey)

  setproperty            machinefolder default| |

                        hwvirtexclusive on|off|

                        vrdeauthlibrary default||

                        websrvauthlibrarydefault|null| |

                        vrdeextpack null||

                        autostartdbpath null||

                        loghistorycount

                        defaultfrontenddefault|

                        logginglevel

  usbfilter              add

                        --target |global

                        --name

                        --action ignore|hold (globalfilters only)

                        [--active yes|no](yes)

                        [--vendorid ](null)

                        [--productid ](null)

                        [--revision ](null)

                        [--manufacturer ](null)

                        [--product ](null)

                        [--remote yes|no] (null, VMfilters only)

                        [--serialnumber ](null)

                        [--maskedinterfaces]

  usbfilter              modify

                        --target |global

                        [--name ]

                        [--action ignore|hold](global filters only)

                        [--active yes|no]

                        [--vendorid |""]

                        [--productid |""]

                        [--revision |""]

                        [--manufacturer|""]

                        [--product |""]

                        [--remote yes|no] (null, VMfilters only)

                        [--serialnumber|""]

                        [--maskedinterfaces]

  usbfilter              remove

                        --target |global

  sharedfolder           add

                        --name --hostpath

                        [--transient] [--readonly][--automount]

  sharedfolder           remove

                        --name[--transient]

  guestproperty           get

                        [--verbose]

  guestproperty           set

                        [ [--flags ]]

  guestproperty           delete|unset

                       

  guestproperty           enumerate

                        [--patterns ]

  guestproperty           wait

                        [--timeout ][--fail-on-timeout]

  guestcontrol           

                         exec[ute]

                          --image--username

                         [--passwordfile | --password ]

                          [--domain] [--verbose] [--timeout ]

                         [--environment "= [=]"]

                         [--wait-exit] [--wait-stdout] [--wait-stderr]

                         [--dos2unix] [--unquoted-args] [--unix2dos]

                          [-- [] ...[]]

                         copyfrom

                         --username

                         [--passwordfile | --password ]

                          [--domain] [--verbose]

                          [--dryrun][--follow] [--recursive]

                         copyto|cp

                         --username

                         [--passwordfile | --password ]

                          [--domain] [--verbose]

                          [--dryrun][--follow] [--recursive]

                         createdir[ectory]|mkdir|md

                          ...--username

                         [--passwordfile | --password ]

                          [--domain] [--verbose]

                         [--parents] [--mode ]

                         removedir[ectory]|rmdir

                          ...--username

                         [--passwordfile | --password ]

                          [--domain] [--verbose]

                         [--recursive|-R|-r]

                         removefile|rm

                          ...--username

                         [--passwordfile | --password ]

                          [--domain] [--verbose]

                         ren[ame]|mv

                          ...--username

                         [--passwordfile | --password ]

                          [--domain] [--verbose]

                         createtemp[orary]|mktemp

                         --username

                         [--passwordfile | --password ]

                         [--directory] [--secure] [--tmpdir ]

                          [--domain] [--mode ] [--verbose]

                          list[--verbose]

                          processkill --session-id

                                    | --session-name

                                    [--verbose]

                                    ...

                          [p[s]]kill--session-id

                                   |--session-name

                                  [--verbose]

                                  ...

                          sessionclose  --session-id

                                    | --session-name

                                    | --all

                                    [--verbose]

                         stat

                          ...--username

                         [--passwordfile | --password ]

                          [--domain] [--verbose]

                         updateadditions

                          [--source] [--verbose]

                         [--wait-start]

                          [-- [] ...[]]

                          watch[--verbose]

  debugvm               

                        dumpguestcore --filename|

                        info [args] |

                        injectnmi |

                        log [--release|--debug]...|

                        logdest [--release|--debug]...|

                        logflags [--release|--debug]...|

                        osdetect |

                        osinfo |

                        getregisters [--cpu ] |all... |

                        setregisters [--cpu ] = ...|

                        show[--human-readable|--sh-export|--sh-eval|

                            --cmd-set] 

                          

                           [[opt] what ...] |

                        statistics [--reset][--pattern ]

                        [--descriptions]

  metrics                list [*|host| []]

                                         (comma-separated)

  metrics                setup

                        [--period ] (default:1)

                        [--samples ] (default:1)

                        [--list]

                        [*|host| []]

  metrics                query [*|host| []]

  metrics                enable

                        [--list]

                        [*|host| []]

  metrics                disable

                        [--list]

                        [*|host| []]

  metrics                collect

                        [--period ] (default:1)

                        [--samples ] (default:1)

                        [--list]

                        [--detach]

                        [*|host| []]

  natnetwork             add --netname

                        --network

                       [--enable|--disable]

                        [--dhcp on|off]

                        [--port-forward-4]

                        [--loopback-4 ]

                        [--ipv6 on|off]

                        [--port-forward-6]

                        [--loopback-6 ]

  natnetwork             remove --netname

  natnetwork             modify --netname

                        [--network ]

                       [--enable|--disable]

                        [--dhcp on|off]

                        [--port-forward-4]

                        [--loopback-4 ]

                        [--ipv6 on|off]

                        [--port-forward-6]

                        [--loopback-6 ]

  natnetwork             start --netname

  natnetwork             stop --netname

  hostonlyif             ipconfig

                        [--dhcp |

                        --ip [--netmask (def:255.255.255.0)] |

                        --ipv6 [--netmasklengthv6(def: 64)]]

                        create |

                        remove

  dhcpserver             add|modify --netname |

                                 --ifname

                        [--ip

                        --netmask

                        --lowerip

                        --upperip ]

                        [--enable |--disable]

  dhcpserver             remove --netname |

                             --ifname

  extpack                install [--replace]|

                        uninstall [--force]|

                       cleanup

4.list命令查看虚拟硬盘的uuid

VBoxManage list hdds

Mac <wbr>OS <wbr>X下VirtualBox如何对硬盘进行扩容
红色框框内的UUID就是我们的目标虚拟硬盘的UUID

5.使用 VBoxManagemodifyhd uuid –-resize capacity命令行来扩容

Mac <wbr>OS <wbr>X下VirtualBox如何对硬盘进行扩容

capacity = x GB * 1024

6.启动虚拟机,进入win7,进行目标磁盘扩展

Mac <wbr>OS <wbr>X下VirtualBox如何对硬盘进行扩容
在【磁盘管理】中,我们可以看到磁盘0这里还有1GB未分配

下一步:右键点击目标盘,然后点击【扩展卷】

Mac <wbr>OS <wbr>X下VirtualBox如何对硬盘进行扩容
Mac <wbr>OS <wbr>X下VirtualBox如何对硬盘进行扩容
Mac <wbr>OS <wbr>X下VirtualBox如何对硬盘进行扩容
Mac <wbr>OS <wbr>X下VirtualBox如何对硬盘进行扩容

7.最后检查

Mac <wbr>OS <wbr>X下VirtualBox如何对硬盘进行扩容

完成扩容!!!!

 

 

 

0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 45岁了月经不来怎么办 吃了芒果身上痒怎么办 10个月宝宝上火怎么办 1个月的宝宝上火怎么办 2个月的婴儿上火怎么办 1岁宝宝不吃奶粉怎么办 奶水不够宝宝又不吃奶瓶怎么办 13岁脸上长粉刺怎么办 脸敷面膜过敏了怎么办 婴儿面膜是假的怎么办 一贴面膜就过敏怎么办 一敷面膜就过敏怎么办 敷了面膜后过敏怎么办 脸做面膜过敏了怎么办 二十几年的疤痕怎么办 三星c5听筒坏了怎么办 胖子减肥后皮肤松弛怎么办 小婴儿脸上长癣怎么办 痘痘里面有脓怎么办 牛仔外套买大了怎么办 脸上痘印红红的怎么办 眼罩里的水干了怎么办 面膜水进眼睛里怎么办 面膜用剩的精华怎么办 火山泥面膜边干怎么办 用完撕拉面膜后怎么办 皮肤锁水能力差怎么办 抱枕永久了脏了怎么办 新买的棉被掉毛怎么办 羊毛被总是窜毛怎么办 骆毛被子掉毛怎么办 太阳晒伤皮肤痒怎么办 皮肤被太阳晒伤怎么办 晒伤皮肤有斑怎么办 晒伤的皮肤变痒怎么办 晒了太阳脸发红怎么办 新棉被没太阳晒怎么办 白掌的叶子发黄怎么办 栀子花长得太高怎么办 新羊毛被有味道怎么办 新买的衣服掉毛怎么办