创建debian 12 虚拟机后,想添加一块新磁盘搞实验。于是,就搜了一下,看看如何添加,找到下面命令:
VBoxManage createhd --filename "C:\Users\<username>\VirtualBox VMs\<vm_name>\NewDisk.vdi" --size 20480
但是看vboxmanage的帮助好像没有这个命令。
VBoxManage help | findstr createhd
但是结果输出:一个createmedium
好像靠点边。
再次查看帮助:VBoxManage help createmedium
,原来 createhd 是以前老版本的名字。
输出了相关的帮助文件:
PS C:\Users\Logic> VBoxManage.exe help createmedium
Oracle VM VirtualBox Command Line Management Interface Version 7.0.18
Copyright (C) 2005-2024 Oracle and/or its affiliates
VBoxManage createmedium -- Create a new medium.
...
The VBoxManage createmedium command creates a new medium, such as a disk image file.
For compatibility with earlier versions of Oracle VM VirtualBox, you can use the createvdi and **createhd** commands instead of the createmedium command.
disk | dvd | floppy
Specifies the media type. The default value is disk.
...
Examples
========
The following command creates a new disk image file named disk01.vdi. The file size is 1024 megabytes.
$ VBoxManage createmedium --filename disk01.vdi --size 1024
The following command creates a new floppy disk image file named floppy01.vdi. The file size is 1 megabyte.
$ VBoxManage createmedium floppy --filename floppy01.img --size 1
The following command creates a raw disk image of an entire physical disk on a Linux host.
$ VBoxManage createmedium disk --filename=/path/to/rawdisk.vmdk --variant=RawDisk --format=VMDK --property RawDrive=/dev/sda
根据这个文档,可以设计了创建新磁盘的命令:
VBoxManage createmedium --filename disk01.vdi --size 10240
创建一个 10G 的新磁盘,默认格式是vdi,其他的要用 --format 指定。
标签:createmedium,--,下用,vdi,vboxmanage,disk,VBoxManage,virtualbox,size From: https://www.cnblogs.com/litifeng/p/18194799