use qemu instead of virtualbox from shell terminal linux kubuntu


http://qemu.weilnetz.de/qemu-doc.html

qemu uses img files instead of vmdk or vdi files so you need to convert

convert a virtual machine :

path_vmdk="/home/shared/debian.vmdk"
path_output_img="/home/shared/debian.vmdk"
qemu-img convert -f vmdk -O raw "$path_vmdk" "path_output_img"

bashrc functions

#USAGE :
#qemu-vmdk_img "/path/to/file"
 
qemu-vmdk_img(){
    path_vmdk="$1"
    path_img="${1%%.*}.img"
    echo "qemu-img convert -f vmdk -O raw "$path_vmdk" "$path_img""
    qemu-img convert -f vmdk -O raw "$path_vmdk" "$path_img"
 
}
 
qemu-vdi_img(){
    path_vdi="$1"
    path_img="${1%%.*}.img"
    echo "qemu-img convert -f vdi -O raw "$path_vdi" "$path_img""
    qemu-img convert -f vdi -O raw "$path_vdi" "$path_img"
 
}
 
qemu-img_vmdk(){
    path_img="$1"
    "$path_vmdk"="${1%%.*}.vmdk"
    echo "qemu-img convert -f raw -O vmdk  "$path_img" "$path_vmdk""
 
    qemu-img convert -f raw -O vmdk  "$path_img" "$path_vmdk"
 
}
 
qemu-img_vdi(){
    path_img="$1"
    path_vdi="${1%%.*}.vdi"
    echo "qemu-img convert -f raw -O vdi "$path_img" "$path_vdi""
 
    qemu-img convert -f raw -O vdi "$path_img" "$path_vdi"
 
}

in this example i used qemu-system-x86_64 for 64bit virtual machine … modify if you need…

in a single line

ram=512 ; vnc="-vnc :1" ; hdd="-hda" ; soundcard=ac97 ;keyboard="it" ; qemu-system-x86_64 -machine pc,accel=kvm -m $ram -k $keyboard -soundhw $soundcard $vnc $hdd /path/to/debian.img

multiline : (you can read better i guess😉 )

ram="512"
vnc="-vnc :1" #enable vnc
hdd="-hda"
soundcard="ac97"
keyboard="it"
qemu-system-x86_64 -machine pc,accel=kvm -m $ram -k $keyboard -soundhw $soundcard $vnc $hdd /path/to/debian.img

sound card :

-soundhw sb16,adlib
-soundhw es1370
-soundhw ac97
-soundhw all

keyboards

ar de-ch es fo fr-ca hu ja mk no pt-br sv
da en-gb et fr fr-ch is lt nl pl ru th
de en-us fi fr-be hr it lv nl-be pt sl tr

modify resolution , terminal , for debian

/etc/default/grub
modify GRUB_GFXMODE=
save and exit
then sudo update-grub

BOOTING FROM ISO IMAGE

qemu-system-x86_64 -boot d -cdrom bridge-kde-2015.02-x86_64.iso -m 512

CREATE A DISK IMAGE WITH QEMU 3GIGABITE FOR HDA THAT IT’S PRETTY SMALL

folder="/home/shared/virtualboxes/mynew_qemu_image.img" ; qemu-img create -f qcow2 "$folder" 3G

so now run qemu with that img

qemu-system-x86_64 -m 512 -hda "/home/shared/virtualboxes/mynew_qemu_image.img" -boot d -cdrom bridge-kde-2015.02-x86_64.iso  

More information here http://superuser.com/questions/598374/how-to-change-the-resolution-of-the-bash-for-a-debian-vm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: