Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- imgfile=$1
- vmname=$2
- if [ -z "$vmname" ]; then
- vmname="BuildStream"
- fi
- vdifile=${vmname}.vdi
- if [ -e "$vdifile" ]; then
- echo "File already exists: $vdifile"
- exit 1
- fi
- # Convert the raw image to VDI format
- VBoxManage convertdd ${imgfile} ${vdifile} --format VDI
- # Create a blank vm (you can use --basefolder option to choose to put it
- # somewhere specific rather than in the default Virtualbox VMs folder)
- VBoxManage createvm --name $vmname --ostype Linux_64 --register
- # Set up memory, networking and other hardware. The `bridegadapter1` argument must be an active network interface
- VBoxManage modifyvm $vmname --ioapic on --memory 2048 --nic1 bridged --bridgeadapter1 en0
- # If your host machine cpu has multiple cores, now would be a good time to
- # configure your VM to use them - for a machine with 4 cores
- VBoxManage modifyvm $vmname --cpus 4
- # Add a SATA controller:
- VBoxManage storagectl $vmname --name "SATA Controller" --add sata --bootable on --portcount 2
- # Attach the hard disc to the image file you downloaded
- VBoxManage storageattach $vmname --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium ${vdifile}
- # Start it up:
- # VBoxManage startvm $vmname
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement