Saminnet-Search Article Wiki Forum Piwigo SNS Cloud vtiger Sugar
vbox cli

  • Data-Articles
    • Desa Nelayan Makmur (70) Fri02,20:43pm

      KALAUツdilihat Desa Bendar tidaklah berbeda dengan desa-desa lainnya. Berada di tepi sungai Juwana, kecamatan Juwana, kabupaten Pati, Jawa Tengah. Pun, tempat ini memiliki pelelangan ikan pula. Yang membedakan dengan desa-desa nelayan lainnya adalah rumah-rumah kokoh dan besar. Ya, desa nelayan ini bukanlah sembarangan desa nelayan. Kebanyakan warga desa ini adalah pengusaha kapal penangkap ikan.…

      Read More...

vbox cli

How to manage VirtualBox in command line or terminal. VBoxManage is the command which is used to manage VirtualBox in commandline. Using VBoxManage, one can create and control the virtual OS and there are many features thanツGUI VirtualBox.

Here is a simple tutorial on how to create a virtual OS (Ubuntu10.10) using VBoxManage and access it remotely from the host machine.

INTRUCTIONS

To create a virtualmachine(Ubuntu10.10), use the below command or copy and paste it in terminal. If you want to create a virtual machine for fedora or some otherツOS,ツchange the name Ubuntu10.10 to fedora or slax or kubuntu etc.

VBoxManage createvm --name Ubuntu10.10

In the above command, 窶createvm窶 is used to create a virtual machine and 窶窶渡ame窶彭efines the name of the virtual machine. After executing this command it will create virtual machine called 窶弑buntu10.10.vbox窶 in home folder under 窶弖irtualBox VMs/Ubuntu10.10/Ubuntu10.10.vbox窶

*Note:ツIf the name has space, then it should be given within quotes.

Say forツexample,ツ窶弑buntu 10.10窶ウ.

Now, create the hard disk image for the virtual machine using the below command

VBoxManage createhd --filename Ubuntu10.10 --size 5120

In the above command, 窶createhd窶 is used to create hard disk image and 窶窶吐ilename窶 is used to specify the virtual machine窶冱 name, for which the hard disk image is created. Here, 窶窶都ize窶 denotes the size of the hard disk image. The size is always given in MB. Hereツwe haveツspecified 5Gb that is 5120MB.

After creating a virtual machine,ツthe VirtualBox has to be registered. 窶registervm窶 command is used to register the virtual machine. The full pathツof the virtual machine窶冱 location has to be mentioned.

VBoxManage registervm '/home/user/VirtualBox VMs/Ubuntu10.10/Ubuntu10.10.vbox'

or

The virtualmachine can be registered while creating virtual machine using 窶窶途egister窶.ツBelow is the command

VBoxManage createvm --name Ubuntu10.10 --register

Now set the OS type. For example, ifツthe Linux OS has to be installed, then specify theツOS type as Linux or Ubuntu Or Fedora etc.

VBoxManage modifyvm Ubuntu10.10 --ostype Ubuntu

One of the most important command in VBoxManage is 窶modifyvm窶. Using 窶徇odifyvm窶, one can modify many features in virtual machine like changing the memory size, name of the Virtual Machine, OS type and many more.ツThe name of the virtual machineツhas to be specified inorderツto modify it.ツIn the above command,ツUbuntu10.10ツhas been explained. The command 窶窶登stype窶 is used to set the OS type like Linux, Windows, Ubuntu, Fedora, etc,.

Now, set the memory size for the virtual OS, i.e. the ram size for the virtual OS from the host Machine.

VBoxManage modifyvm Ubuntu10.10 --memory 512

The command 窶窶杜emory <size>窶 is used to set the RAM size for the virtual machine from the host machine. The size should be defined in MB.

Now create a storage controller for the virtual machine.

VBoxManage storagectl Ubuntu10.10 --name IDE --add ide --controller PIIX4 --bootable on

storagectl <name>窶 is used to create a storage controller for virtual machine. Laterツthe virtual media can be attached to the controller using 窶storageattach窶 command. The above command creates the storage controller called IDE. <name> defines the name of the virtual machine.

Here,

窶渡ame <name>窶 specifies the name of the storage controller that needs to be created or modified or removed from the virtual machine.

窶殿dd <options>窶 defines the type of system bus to which the storage controller must be connected. Available options are ide/sata/scsi/floppy.

窶田ontroller <options>窶 allows to choose the type of chipsetツthat is to beツemulated for the given storage controller. Available options are LsiLogic / LSILogicSAS / BusLogic / IntelAhci / PIIX3 / PIIX4 / ICH6 / I82078.

窶澱ootable <on/off>窶 defines whether this controller is bootable or not.

VBoxManage storagectl Ubuntu10.10 --name SATA --add sata --controller IntelAhci --bootable on

Usingツthe above command, a storage controller called SATA has been created.ツThe hard disk image can be attached to this later.

Now, attach the storage controller to the virtual machine using 窶徭torageattach窶 .

VBoxManage storageattach Ubuntu10.10 --storagectl SATA --port 0 --device 0 --type hdd --medium "filename"

The above command will attach the storage controller SATA to virtual machine Ubuntu10.10 with the medium i.e., to the virtual disk image which is created.

storageattach <name>窶 is the command used to attach the storage controller to the virtual machine.

<name> defines the name of the virtual machine.

窶都toragectl <name>窶 is used to define the name of the storage controllerツwhich needs to be attached to the virtual machine.

<name> defines the name of the storage controller.

窶菟ort <number>窶 is used to define the number of storage controller窶冱 port which is to be modified.

窶電evice <number>窶 is used to define the number of the port窶冱 device which is to be modified.

窶鍍ype <options>窶 is used to specify the type of the drive in which the medium should be attached. Available options are dvddrive / hdd / fdd.

窶杜edium <options>窶 defines the hard disk image or ISO image file or virtual DVD. Available options are none / emptydrive / <uuid> / <filename>host:<drive>iscsi

*Note:ツIf you decide to specify the filename, then specify the full path where it isツlocated.

Example: 窶/home/user/Ubuntu10.10.vdi窶

VBoxManage storageattach Ubuntu10.10 --storagectl IDE --port 0 --device 0 --type dvddrive --medium "filename"

Here, the above command will attach the storage controller IDE with the medium of ISO image as DVD drive.ツThis medium can be closed after installing the virtual OS(Ubuntu10.10).

filename窶懌督Example: 窶/home/user/Downloads/ubuntu-10.10-desktop-i386.iso窶

Next, add some features like audio, 3d acceleration, network, etc,.

VBoxManage modifyvm Ubuntu10.10 --vram 128 --accelerate3d on --audio alsa --audiocontroller ac97

窶砺ram <size>窶 This sets theツsize of RAM that the virtual graphics card should have. The size should given in MB.

窶殿ccelerate3d <on/off>窶 if the guest additions are installed, this sets the hardware 3D acceleration for the virtual machine.

窶殿udio <options>窶 is used to set the audio for the virtual machine with available host driver. Available options are none /null / oss / alsa / pulse.

窶殿udiocontroller <options>窶 is used to set the controller for the audio in the virtual machine. Available options are ac97 / hda / sb16.

VBoxManage modifyvm Ubuntu10.10 --nic1 nat --nictype1 82540EM --cableconnected1 on

窶渡ic<1-N> <options>窶 with this the type of networkingツcan be set for each of the VM窶冱 virtual network cards. Available options are none / null / nat / bridged / intnet / hostonly / vde.

窶渡ictype<1-N> <options>窶 is used to specify which networking hardwareツis to beツpresented to the guest VirtualBox. Available options are Am79C970A / Am79C973 / 82540EM / 82543GCツ/ 82545EM / virtio.

窶田ableconnected<1-N> <on/off>窶 This allows to temporarily disconnect a virtual network interface from virtual machine. This might be useful for re-setting certain software components in the VM.

Now to start a virtual machine, use the below command

VBoxManage startvm Ubuntu10.10

startvm <name>窶 is the command used to start the virtual machine. By default it starts in the GUI mode.

<name> defines the name of the virtual machine.

Remote Desktop in VirtualBox

To activate the remote desktop, set the port number and address.

VBoxManage modifyvm Ubuntu10.10 --vrde on --vrdeport 5012 --vrdeaddress 192.168.1.6

窶砺rde <on/off>窶 is used to set the remote desktopツON or OFF.

窶砺rdeport <number>窶 is used to set the port number in the port in which the virtual machine should be available. 窶彭efault or 0窶ウ will set the port in 3389.

窶砺rdeaddress <address>窶 is used to set the 窶廬P窶 address in which it should be accessable.

Now, start the virtual machine using the below command

VBoxManage startvm Ubuntu10.10 --type headless

窶鍍ype <options>窶 is used to specify the mode in which it should start the virtual machine. Available options are gui / sdl / headless.

headless窶敖produces no visible output on the host at all, butツonly delivers VRDP data. This front-end has no dependencies on the X Window system on Linux and Solaris hosts.

Alternative method to start virtual machine for remote access is VBoxHeadless.ツUseツthe below command.

VBoxHeadless --startvm Ubuntu10.10

窶都tartvm <name>窶 is used to start the virtual machine. <name> defines the name of the virtual machine.

To access the remote desktop, use rdesktop command. By default the linux system should have rdesktop. If not, install it. Use the below command from the client machine to access the virtual machine remotely.

rdesktop -a 16 -Nツ192.168.1.6:5012

To stop the virtual machine, check the below command

VBoxManage controlvm Ubuntu10.10 poweroff

窶彡ontrolvm <name> <options>窶 controlvm command is used to control the state of the virtual machine. <name> defines the name of the virtual machine. Some of the available options are pause / resume / reset / poweroff / savestate / acpipowerbutton / acpisleepbutton. There are many options in controlvm to see all the options available in it. Either type or copy and paste the below command in terminal.

VBoxManage controlvm

Hope this will be helpful for you!!!

Comments   

 
0 #1 Guest 2019-07-07 10:16
Thanks for the auspicious writeup. It if truth be told was once a eentertainment account it.
Glance complicated to far brought agreeable from you!
However, how coiuld we keep in touch?

My web page: _____ ________ ____ [Ada]
Quote
 

Articles by Date

TweetTweet Share on LinkedInShare on LinkedIn Share on Google+Google+ Submit to RedditReddit Publish on WordPress WordPress Send emailSend email