我试图使用VBoxManage在CentOS 7服务器上创建和管理CentOS 7虚拟机。下面的命令首先产生以下相互矛盾的语句:
1.)虚拟机已经成功启动,
2.)但是,当随后给出命令来列出正在运行的VM时,没有列出虚拟机。
3.)然后,另一个描述新虚拟机的命令声明它没有运行,并且没有操作系统。
引导序列涉及从DVD驱动器中的dvd启动将CentOS安装到虚拟机中。那么,如何修改下面的VBoxManage代码以触发CentOS 7安装到仅在终端安装CentOS 7主机操作系统的虚拟机中呢?我想任何Linux的答案都是一样的,因为这是VBoxManage代码。
以下是我迄今输入的内容,没有抛出任何错误:
[root@localhost ~]# VBoxManage createvm --name "testvm" --register
[root@localhost ~]# VBoxManage storagectl testvm --name "IDE Controller" --add ide
[root@localhost ~]# VBoxManage createhd --filename testvm.vdi --size 500000
[root@localhost ~]# VBoxManage storageattach testvm --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium testvm.vdi
[root@localhost ~]# VBoxManage modifyvm testvm –boot1 dvd
[root@localhost ~]# VBoxManage startvm testvm
Waiting for VM "testvm" to power on...
VM "testvm" has been successfully started.
[root@localhost home]# VBoxManage list runningvms
[root@localhost home]# VBoxManage showvminfo testvm
Name: testvm
Groups: /
Guest OS: Other/Unknown
UUID: 00c5408d-6394-4baa-af27-9e52203db029
Config file: /root/VirtualBox VMs/testvm/testvm.vbox
Snapshot folder: /root/VirtualBox VMs/testvm/Snapshots
Log folder: /root/VirtualBox VMs/testvm/Logs
Hardware UUID: 00c5408d-6394-4baa-af27-9e52203db029
Memory size: 128MB
Page Fusion: off
VRAM size: 8MB
CPU exec cap: 100%
HPET: off
Chipset: piix3
Firmware: BIOS
Number of CPUs: 1
PAE: on
Long Mode: on
CPUID Portability Level: 0
CPUID overrides: None
Boot menu mode: message and menu
Boot Device (1): DVD
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI: on
IOAPIC: off
Time offset: 0ms
RTC: local time
Hardw. virt.ext: on
Nested Paging: on
Large Pages: off
VT-x VPID: on
VT-x unr. exec.: on
Paravirt. Provider: Default
State: powered off (since 2015-09-29T00:09:23.000000000)
Monitor count: 1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address:
Teleporter Password:
Tracing Enabled: off
Allow Tracing to Access VM: off
Tracing Configuration:
Autostart Enabled: off
Autostart Delay: 0
Default Frontend:
Storage Controller Name (0): IDE Controller
Storage Controller Type (0): PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0): 2
Storage Controller Port Count (0): 2
Storage Controller Bootable (0): on
IDE Controller (0, 0): /root/testvm.vdi (UUID: f6eef452-6003-47a5-ad89-fcd973a52304)
NIC 1: disabled
NIC 2: disabled
NIC 3: disabled
NIC 4: disabled
NIC 5: disabled
NIC 6: disabled
NIC 7: disabled
NIC 8: disabled
Pointing Device: PS/2 Mouse
Keyboard Device: PS/2 Keyboard
UART 1: disabled
UART 2: disabled
LPT 1: disabled
LPT 2: disabled
Audio: disabled
Clipboard Mode: disabled
Drag and drop Mode: disabled
VRDE: disabled
USB: disabled
EHCI: disabled
XHCI: disabled
USB Device Filters:
<none>
Bandwidth groups: <none>
Shared folders: <none>
Video capturing: not active
Capture screens: 0
Capture file: /root/VirtualBox VMs/testvm/testvm.webm
Capture dimensions: 1024x768
Capture rate: 512 kbps
Capture FPS: 25
Guest:
Configured memory balloon size: 0 MB
[root@localhost home]# 发布于 2015-09-30 21:56:09
是的,当VM运行任何代码、BIOS、引导、操作系统或用户时,它都会被“启动”。
您选择了-boot1 dvd,但没有在VM中放置任何虚拟DVD驱动器。您需要将虚拟DVD存储到一个storageattach文件中,或者使用一个真实的DVD驱动器(主机)。显然,对于CentOS 7,您需要一个CentOS 7安装程序DVD/映像。一旦安装程序运行了IME,它就需要一个(虚拟)显示;如果服务器上没有显示,但是可以从一台机器连接,如果安装了“扩展包”,可以使用VRDP。在VirtualBox手册的7.1.1-3节(如果没有本地的话,可以在http://www.virtualbox.org/manual/UserManual.html在线)对此作了简要的解释。
如果您没有使用真实显示器或VRDP的虚拟显示器,我认为您将需要一个运行“无头”的CentOS安装程序(以及由此安装的系统),使用连接到它认为是一个终端的虚拟串行端口,这实际上是您使用的一些仿真。你只能靠自己了。在带有显示器的机器上构建VM并在其中安装CentOS可能更容易,可以让它在没有显示的情况下工作(可能是使用ssh上的所有内容),然后将VM导出/导入到要运行它的服务器。
https://unix.stackexchange.com/questions/233070
复制相似问题