vbox 命令行操作

老大让搭个服务器,做IoT端的接受服务器。我选了KAA,官网提供vbox的沙盒镜像,直接装即可。

服务器上装的是centos,我就想直接在centos上装virtuanl box ,然后导入沙盒。奈何服务器是个workstation,木有图形界面,一下懵逼了。镇定之下,想起可以命令行导入虚拟机。


1.导入虚拟机 VBoxManage  import kaa-sandbox-0.9.0.ova

kaa-sandbox-0.9.0.ova 文件是我从官网上下载的KAA对应virtual box的虚拟镜像


2.查询虚拟机 ID VBoxManage list vms 

"Kaa Sandbox Ubuntu 64 bit" {31ada67a-2c94-432d-ab5f-05ffad13b7f7


3.启动虚拟机VBoxManage  startvm "Kaa Sandbox Ubuntu 64 bit"


4.启动的时候发现warmning:

WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (3.10.0-327.el7.x86_64) or it failed to
         load. Please recompile the kernel module and install it by


           sudo /sbin/vboxconfig


         You will not be able to start VMs until this problem is fixed.


5.于是执行/sbin.vboxconfig,又发现warmning:

root@localhost ~]# sudo /sbin/vboxconfig 
vboxdrv.sh: Building VirtualBox kernel modules.
This system is not currently set up to build kernel modules (system extensions).
Running the following commands should set the system up correctly:


  yum install gcc make
  yum install kernel-devel-3.10.0-327.el7.x86_64
(The last command may fail if your system is not fully updated.)
  yum install kernel-devel



6.发现还是不行.google了下,发现是因为我的server没有图形界面的原因,启动时需要如下命令:

 VBoxManage startvm Machine --type headless 

你可能感兴趣的:(运维这块)