Use VBoxManage to install Linux on the Linux Command Line
Environment: Ubuntu 15.04 64bit, virtualbox 5.0.16
Preparation: download and install virtualbox and virtualbox-extensions, and prepare iso system files, such as archlinux. iso.
1. Create a vbox directory.
$ Cd
$ Cd VirtualBox \ VMs/
$ Mkdir arch
$ Cd arch
2. Create a New vbox disk. The -- size parameter sets the size. Unit: M.
$ Vboxmanage createmedium disk -- filename arch. vdi -- size 10000
3. Create a vbox Virtual Machine file. -- ostype sets the system format (windows/ubuntu, etc.) installed on the virtual machine. You can use vboxmanage list ostypes to view the supported system formats of vbox.
$ Vboxmanage createvm -- name arch -- ostype "linux_64" -- register
4. Create a SATA disk controller and bind the disk created in step <2> to the VM file.
$ Vboxmanage storagectl arch -- name "SATA Controller" -- add sata -- controller intelohci
$ Vboxmanage storageattach arch -- storagectl "SATA Controller" -- port 0 -- device 0 -- type hdd -- medium arch. vdi
5. Create an IDE controller, set it to a dvd, and bind the ios file to the dvd. Note that -- medium is your iso path.
$ 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. view your network card and set the vbox network card as a bridge.
$ Ifconfig
Output:
Wlp18s0 Link encap: Ethernet HWaddr xx: xx
Inet addr: 192.168.0.101 Bcast: 192.168.0.255 Mask: 255.255.255.0
My Nic is wlp18s0, so bind the vbox nic1 Nic to it.
$ Vboxmanage modifyvm arch -- nic1 bridged -- bridgeadapter1 wlp18s0
6. set io control, startup item, and memory.
$ Vboxmanage modifyvm arch -- ioapic on
$ Vboxmanage modifyvm arch -- boot1 dvd -- boot2 disk -- boot3 none -- boot4 none
$ Vboxmanage modifyvm arch -- memory 1024 -- vram 128
7. Set rdpe Remote Desktop.
$ Vboxmanage modifyvm arch -- vrdeport 3389 -- vrdeaddress 0.0.0.0
8. Enable vbox in the background.
$ Vboxmanage startvm arch -- type = headless
9. Now you can use rdesktop to connect to the background.
$ Rdesktop localhost: 3389
10. Exit the iso on the dvd after the installation is complete.
$ Vboxmanage storageattach arch -- storagectl "IDE Controller" -- port 0 -- device 0 -- type dvddrive -- medium none
11. Check the running vbox system and shut down.
$ Vboxmanage list runningvms
$ Vboxmanage controlvm arch poweroff
Finally, you can view the help information for other functions.
$ Vboxmanage -- help
This article permanently updates the link address: