Linux命令列下使用VBoxManage安裝Linux系統

來源:互聯網
上載者:User

Linux命令列下使用VBoxManage安裝Linux系統

環境:Ubuntu 15.04 64bit,virtualbox 5.0.16

準備:下載安裝好virtualbox,virtualbox-extensions,準備好iso系統檔案,如archlinux.iso。

1.建立好vbox的目錄。

$ cd
$ cd VirtualBox\ VMs/
$ mkdir arch
$ cd arch

2.建立一個vbox磁碟,--size參數設定大小,單位:M。

$ vboxmanage createmedium disk --filename arch.vdi --size 10000

3.建立vbox虛擬機器檔案,--ostype設定虛擬機器安裝的系統格式(windows/ubuntu等),可以使用vboxmanage list ostypes查看vbox支援的系統格式。

$ vboxmanage createvm --name arch --ostype "linux_64" --register

4.建立SATA磁碟控制卡並將步驟<2>中建立的磁碟綁定到虛擬機器檔案。

$ vboxmanage storagectl arch --name "SATA Controller" --add sata --controller IntelAHCI
$ vboxmanage storageattach arch --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium arch.vdi

5.建立IDE控制器,設定它為dvd,並綁定ios檔案到該dvd,注意--medium為你的iso路徑。

$ vboxmanage storagectl arch --name "IDE Controller" --add ide
$ vboxmanage storageattach arch --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium /path/to/arch.iso

5.查看自己的網卡,並設定vbox網卡為橋接。

$ ifconfig

輸出:

wlp18s0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:192.168.0.101 Bcast:192.168.0.255 Mask:255.255.255.0

我的網卡是wlp18s0,所以將vbox nic1網卡綁定到它。

$ vboxmanage modifyvm arch --nic1 bridged --bridgeadapter1 wlp18s0

6.設定io控制,啟動項,記憶體等。

$ vboxmanage modifyvm arch --ioapic on
$ vboxmanage modifyvm arch --boot1 dvd --boot2 disk --boot3 none --boot4 none
$ vboxmanage modifyvm arch --memory 1024 --vram 128

7.設定rdpe遠端桌面。

$ vboxmanage modifyvm arch --vrdeport 3389 --vrdeaddress 0.0.0.0

8.後台開啟vbox。

$ vboxmanage startvm arch --type=headless

9.現在就可以用rdesktop聯結後台了

$ rdesktop localhost:3389

10.安裝完成後退出dvd上的iso。

$ vboxmanage storageattach arch --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium none

11.查看正在啟動並執行vbox系統,關機。

$ vboxmanage list runningvms
$ vboxmanage controlvm arch poweroff

最後,其餘功能可以查看協助。

$ vboxmanage --help

本文永久更新連結地址:

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.