各位大大
时间:2011-06-02
来源:互联网
本文作为笔记,供大家参考,已测试成功
系统ubuntu10.04 server,无图形界面
安装vbox
根据官网介绍进行
使用vbox
1.新建注册一个virtual machine,简称vm(相当于你去电脑城买主板和cpu)
在shell下输入
2.现在新建硬盘(虚拟硬盘)(相当于你去电脑城买硬盘)
3.配置电脑
4.安装扩展包,如不安装,无法使用vrdp连接,此服务器无图形界面
5.启动虚拟电脑
大部分操作参考书生意气的博客,在此表示感谢
系统ubuntu10.04 server,无图形界面
安装vbox
根据官网介绍进行
代码:
编辑
/etc/apt/sources.list
文件,第一行加入
deb http://download.virtualbox.org/virtualbox/debian lucid contrib non-free
然后在shell里输入
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
接着更新,然后安装
sudo apt-get update
sudo apt-get install virtualbox-4.0
安装时会下载大约60-70mb安装文件,会比较慢
后面还要安装dkms,好像是ubuntu内核升级后需要用到,我暂时没装
/etc/apt/sources.list
文件,第一行加入
deb http://download.virtualbox.org/virtualbox/debian lucid contrib non-free
然后在shell里输入
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
接着更新,然后安装
sudo apt-get update
sudo apt-get install virtualbox-4.0
安装时会下载大约60-70mb安装文件,会比较慢
后面还要安装dkms,好像是ubuntu内核升级后需要用到,我暂时没装
使用vbox
1.新建注册一个virtual machine,简称vm(相当于你去电脑城买主板和cpu)
在shell下输入
代码:
vboxmanage createvm --name "xp" --register
这句话打完就等于你有了虚拟机的主板、cpu了
配置信息会放在自己家目录的“VirtualBox VMs”目录
这句话打完就等于你有了虚拟机的主板、cpu了
配置信息会放在自己家目录的“VirtualBox VMs”目录
2.现在新建硬盘(虚拟硬盘)(相当于你去电脑城买硬盘)
代码:
vboxmanage createhd --filename "xp.vdi" --size 50000
在shell当前目录(/home/wayne/)下加了一块文件名为xp.vdi的虚拟硬盘,这个硬盘大小是50000MB(50G)
虽然xp.vdi的文件大小不是50G,但它会按具体情况自动动态增长
在shell当前目录(/home/wayne/)下加了一块文件名为xp.vdi的虚拟硬盘,这个硬盘大小是50000MB(50G)
虽然xp.vdi的文件大小不是50G,但它会按具体情况自动动态增长
3.配置电脑
代码:
修改系统类型
VBoxManage modifyvm "xp" --ostype "WindowsXP"
VBoxManage modifyvm "xp" --ostype "WindowsXP"
代码:
设置内存512m,显存16m
VBoxManage modifyvm "xp" --memory "512" --vram "16"
VBoxManage modifyvm "xp" --memory "512" --vram "16"
代码:
设置启动顺序及挂载一个磁盘
VBoxManage modifyvm "xp" --boot1 dvd --hda "/home/wayne/winxp.vdi" --sata on
以上命令可能会出现错误提示
ERROR: Could not find a storage controller named 'IDE Controller'
此时需要添加一个IDE接口即可
VBoxManage storagectl xp --name "IDE Controller" --add ide
然后再重复执行出错的命令
VBoxManage modifyvm "xp" --boot1 dvd --hda "/home/wayne/winxp.vdi" --sata on
以上命令可能会出现错误提示
ERROR: Could not find a storage controller named 'IDE Controller'
此时需要添加一个IDE接口即可
VBoxManage storagectl xp --name "IDE Controller" --add ide
然后再重复执行出错的命令
代码:
先将挂载的ISO文件,加到虚拟机的DVD光驱里
VBoxManage modifyvm "xp" --dvd /home/wayne/winxpsp3.iso
如报以下错误
ERROR: No storage device attached to device slot 0 on port 1 of controller 'IDE Controller'
或
error: No drive attached to device slot 0 on port 1 of controller 'IDE Controller'
请如下执行
将winxp.vdi 磁盘放在设备0的第0个端口
VBoxManage storageattach xp --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium /home/wayne/winxp.vdi
将ISO挂载在设备0的第1个端口
VBoxManage storageattach xp --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium /home/wayne/winxpsp3.iso
VBoxManage modifyvm "xp" --dvd /home/wayne/winxpsp3.iso
如报以下错误
ERROR: No storage device attached to device slot 0 on port 1 of controller 'IDE Controller'
或
error: No drive attached to device slot 0 on port 1 of controller 'IDE Controller'
请如下执行
将winxp.vdi 磁盘放在设备0的第0个端口
VBoxManage storageattach xp --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium /home/wayne/winxp.vdi
将ISO挂载在设备0的第1个端口
VBoxManage storageattach xp --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium /home/wayne/winxpsp3.iso
4.安装扩展包,如不安装,无法使用vrdp连接,此服务器无图形界面
代码:
先确定vbox版本
vboxmanage -v
然后去[url=http://download.virtualbox.org/virtualbox/4.0.8/]官网(以4.0.8为例)[/url]下载对应的[url=http://download.virtualbox.org/virtualbox/4.0.8/Oracle_VM_VirtualBox_Extension_Pack-4.0.8-71778.vbox-extpack]extpack[/url]
然后shell运行
sudo vboxmanage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.0.8-71778.vbox-extpack
vboxmanage -v
然后去[url=http://download.virtualbox.org/virtualbox/4.0.8/]官网(以4.0.8为例)[/url]下载对应的[url=http://download.virtualbox.org/virtualbox/4.0.8/Oracle_VM_VirtualBox_Extension_Pack-4.0.8-71778.vbox-extpack]extpack[/url]
然后shell运行
sudo vboxmanage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.0.8-71778.vbox-extpack
5.启动虚拟电脑
代码:
vboxheadless -s xp
成功的是显示
Oracle VM VirtualBox Headless Interface 4.0.8
(C) 2008-2011 Oracle Corporation
All rights reserved.
VRDE server is listening on port 3389.
如果第4步不做,则3389那行没有,也无法用rdp连接
成功的是显示
Oracle VM VirtualBox Headless Interface 4.0.8
(C) 2008-2011 Oracle Corporation
All rights reserved.
VRDE server is listening on port 3389.
如果第4步不做,则3389那行没有,也无法用rdp连接
大部分操作参考书生意气的博客,在此表示感谢
作者: waynehu 发布时间: 2011-06-02
命令行v5...

作者: 枫叶饭团 发布时间: 2011-06-02
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28