在服务器上创建虚拟机
来源:互联网 发布:五点共圆 知乎 编辑:程序博客网 时间:2024/09/21 06:37
由于服务器一般是没有显示器这种图形显示设备的,所以讲一讲如何在服务器中创建虚拟机。
前提准备
- 在服务器上安装了VirtualBox。
- 服务器上有虚拟机操作系统的iso文件。(以Ubuntu16.04为例)
下载ubuntu16.04镜像命令:wget http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso
- 一个连接到服务器的终端(例如xshell)。
创建步骤
- 创建一个新的虚拟机:
VBoxManage createvm --name "ubuntu" --ostype ubuntu_64 --register
注意:如果没有指定--register参数,那么需要在后续的命令中使用registervm命令。
特别注意:指定--ostype参数,可以为新的虚拟机使用默认参数,例如RAM大小,虚拟网络设备等。查看VirtualBox支持的所有操作系统,可以使用VBoxManage list ostypes
为虚拟机指定设置信息:
VBoxManage modifyvm "ubuntu" --memory 256 --acpi on --boot1 dvd --nic1 nat
为虚拟机创建虚拟硬盘(例如,20GB):
VBoxManage createhd --filename "ubuntu.vdi" --size 20000
为虚拟机添加IDE控制器:
VBoxManage storagectl "ubuntu" --name "IDE Controller" --add ide --controller PIIX4
将第三步中创建的虚拟硬盘添加到虚拟机:
VBoxManage storageattach "ubuntu" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium "ubuntu.vdi"
将需要安装的操作系统iso文件添加到虚拟机:
VBoxManage storageattach "ubuntu" --storagectl "IDE Controller" --port 0 --device 1 --type dvddrive --medium /full/path/to/iso.iso
启动虚拟机:
VBoxManage startvm "ubuntu" --type headless
其他命令
关闭虚拟机:
VBoxManage controlvm "ubuntu" poweroff
阅读全文
1 0
- 在服务器上创建虚拟机
- 在微软Azure的服务器上创建Windows虚拟机的教程
- 在服务器上创建用户
- git 在服务器上创建
- 在服务器上创建目录
- 在虚拟机Ubuntu上搭建samba服务器
- 在ESXi上,创建虚拟机方法
- 在虚拟机上同步服务器上的时间_Hbase
- 在FTP服务器上创建目录
- 在远程服务器上创建数据库
- 使用svn在服务器上创建项目
- VBScript在服务器上创建目录
- 在LINUX上创建GIT服务器
- 在LINUX上创建GIT服务器
- 在LINUX上创建GIT服务器
- 在服务器上创建git仓库
- 如何在windows上创建FTP服务器
- 在虚拟机上搭建LVS+Keepalived服务器集群
- 硬盘分区表知识——详解硬盘MBR
- HDU
- Jenkins之定时构建
- 【HDU 1257】最少拦截系统(贪心)
- redis之主从复制
- 在服务器上创建虚拟机
- 登陆界面的数据存储(没有显式使用其他保存媒介)
- 千寻穗学习日记8.23
- rf报错集锦
- Caused by: org.apache.catalina.LifecycleException: A child container failed
- 为自己做的小计划 (电影类)-2
- 单调递增最长子序列
- DES加密解密
- 【线段树多符号区间更新】HDU