LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   GUI frontend for QEMU (https://www.linuxquestions.org/questions/slackware-14/gui-frontend-for-qemu-4175576966/)

TarFile 04-07-2016 11:00 PM

GUI frontend for QEMU
 
Is there any good supported (by the maintainer) frontend for QEMU?

I use AQEMU but it's not being maintained as far as I can tell as the last update was sometime in 2013.

I use VirtualBox also but QEMU actually has some interesting features that make it work better for some things. :)

I just get tired of typing in long commands or making little scripts to run things. :doh:

willysr 04-07-2016 11:23 PM

Virt-manager

kikinovak 04-08-2016 12:24 PM

1 Attachment(s)
Virt-Manager is nice. I'm using it every day.

Ramurd 04-08-2016 04:46 PM

years ago I wrote this script; I still use it...

Code:

#!/bin/ksh

# ksh is more or less required due to scoping of variables
# bash is picky and doesn't scope outside piped loops :-(

machine=${1}
inifile="${HOME}/bin/manage_vm.ini"

parse_inifile()
{
        if [ "${machine}" = "list"  ]
        then
                cat ${inifile} | grep -v "^#" | grep -e "^\[.*\]$" | cut -d '[' -f 2 - | cut -d ']' -f 1
                return
        fi

        section_start=`cat ${inifile} | grep -v "^#" | grep -n "^\[${machine}\]$" | cut -d ':' -f 1`

        if [ -z "${section_start}" ]
        then
                echo "No [${machine}] section found; valid sections are: "
                cat ${inifile} | grep -v "^#" | grep -e "^\[.*\]$" | cut -d '[' -f 2 - | cut -d ']' -f 1
                exit
        fi

        section_end=`cat ${inifile} | grep -v "^#" | grep -e "^$" -n | cut -d ':' -f 1 | while read num
        do
                if [ ${num} -gt ${section_start} ]
                then
                        echo ${num}
                fi
        done | head -n 1`

        ((diff=section_end - section_start))
                                                                                                                                                                                                                                           
        echo "Start: ${section_start}"                                                                                                                                                                                                     
        echo "End  : ${section_end}"                                                                                                                                                                                                       
        echo "Diff : ${diff}"                                                                                                                                                                                                               
        cat ${inifile} | grep -v "^#" | tail -n +${section_start} | head -n ${diff} | while read option                                                                                                                                     
        do                                                                                                                                                                                                                                 
                echo "${#OPT[*]}: ${option}"                                                                                                                                                                                               
                OPT[${#OPT[*]}]=${option}                                                                                                                                                                                                   
        done                                                                                                                                                                                                                               
}                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                           
parse_options()                                                                                                                                                                                                                             
{                                                                                                                                                                                                                                           
        COUNT=0                                                                                                                                                                                                                             
        PARAMETERS=""                                                                                                                                                                                                                       
        QEMU_BIN=/usr/bin/qemu-system-x86_64                                                                                                                                                                                               
        QEMU_AUDIO_DRV=sdl                                                                                                                                                                                                                 
        export SDL_AUDIODRIVER=alsa                                                                                                                                                                                                         
                                                                                                                                                                                                                                           
        while [ ${COUNT} -lt ${#OPT[*]} ]                                                                                                                                                                                                   
        do                                                                                                                                                                                                                                 
                ((COUNT+=1)) # we can safely do this; as OPT[0] is the section header                                                                                                                                                       
                ARG=`echo ${OPT[${COUNT}]} | cut -d '=' -f 1`                                                                                                                                                                               
                VAL=`echo ${OPT[${COUNT}]} | cut -d '=' -f 2-`                                                                                                                                                                             
                                                                                                                                                                                                                                           
                case ${ARG} in                                                                                                                                                                                                             
                        "")                                                                                                                                                                                                                 
                                echo "${machine} parsed."                                                                                                                                                                                   
                                ;; # yes pretty silly, right?                                                                                                                                                                               
                        "qemu_bin") # with qemu_bin you can configure another qemu binary                                                                                                                                                   
                                QEMU_BIN="${VAL}"                                                                                                                                                                                           
                                ;;                                                                                                                                                                                                         
                        "machine")                                                                                                                                                                                                         
                                PARAMETERS="${PARAMETERS}-M ${VAL} "                                                                                                                                                                       
                                ;;                                                                                                                                                                                                         
                        *)
                                PARAMETERS="${PARAMETERS} -${ARG} ${VAL} "
                                ;;
                esac
        done
        echo ${PARAMETERS}
}

main()
{
        parse_inifile
        parse_options

        case $1 in
                "stop")
                        echo "Not implemented yet."
                        ;;
                "start")
                        ${QEMU_BIN} ${PARAMETERS}
                        ;;
        esac
}

if [ -z "${1}" ]
then
        PS3="Choose: "
        select choice in `$0 list` quit
        do
                if [ "${choice}" = "quit" ]
                then
                        return 0
                else
                        $0 $choice start
                fi
        done
#      echo "Usage: $0 <machine|"list"> <stop|start|restart|status>"
#      return 1
fi

if [ "${1}" = "list" ]
then
        main list
        return 0
fi

if [ -z "${2}" ]
then
        echo "Usage: $0 <machine|"list"> <stop|start|restart|status|prepare_listen>"
        return 1
fi

case ${2} in
        "stop")
                echo "Not implemented yet."
                ;;
        "start")
                main start
                ;;
        "prepare_listen")
                echo "Not implemented yet."
                ;;
        "status")
                echo "Not implemented yet."
                ;;
        "restart")
                echo "Not implemented yet."
                ;;
        *)
                echo "Invalid action: actions are: stop, start, restart or status"
                ;;
esac

The ini file it uses has entries that look like this:
Code:


[broker1]
qemu_bin=/usr/bin/qemu-system-x86_64
monitor=stdio
smp=4,cores=2,sockets=2
vga=vmware
cpu=qemu64
m=4096
balloon=virtio
localtime=
drive=file=/qcow/broker1.qcow2,if=virtio
drive=file=/qcow/broker1-data.qcow2,if=virtio
cdrom=/qcow/iso/Slackware/slackware64-14.1-install-dvd.iso
boot=once=cd,menu=on
net=nic,vlan=0,macaddr=52:54:00:e7:91:b4,model=virtio
net=vde,vlan=0
name="broker1"
enable-kvm=

[broker2]
qemu_bin=/usr/bin/qemu-system-x86_64
monitor=stdio
smp=6,cores=2,sockets=3
vga=vmware
cpu=qemu64
m=4096
balloon=virtio
localtime=
drive=file=/qcow/broker2.qcow2,if=virtio
drive=file=/qcow/broker2-data.qcow2,if=virtio
cdrom=/qcow/iso/Slackware/slackware64-14.1-install-dvd.iso
boot=once=cd,menu=on
net=nic,vlan=0,macaddr=52:54:00:e7:91:b5,model=virtio
net=vde,vlan=0
name="broker2"
enable-kvm=

every ini field has a direct mapping to the qemu-command... have to admit that I wrote this script because virsh/virt-manager didn't have the options added yet that qemu had and that I wanted to use :-)

slacker1337 04-08-2016 06:34 PM

I'm not a fan of all the dependencies for virt-manager, which has always kept me from installing it. I manage all my VMs with expect scripts for auto-start/stop of VMs, or just shell scripts for manually started VMs.

TarFile 04-08-2016 08:01 PM

Well I am trying to install virt-manager on current and so far have not been able to pull it off.

TarFile 04-09-2016 12:45 AM

Well I got it to work more or less.

It does not like spice for some reason.

And USB redirection.

Ramurd 04-09-2016 07:12 AM

Quote:

Originally Posted by TarFile (Post 5528448)
Well I got it to work more or less.

It does not like spice for some reason.

And USB redirection.

also tried it out; doesn't find my vde network either; I'll stick with my script :-)

kikinovak 04-10-2016 01:03 PM

For what it's worth, here's a link to my notes on Qemu/KVM, libvirt and virt-manager.

http://www.microlinux.fr/microlinux/.../KVM-HOWTO.txt

I'm using this stuff every day on Slackware workstations and servers. Works perfectly.

TarFile 04-10-2016 02:02 PM

kikinovak I don't suppose you have your notes in English as I don't speak French?

bassmadrigal 04-10-2016 08:14 PM

Quote:

Originally Posted by TarFile (Post 5529014)
kikinovak I don't suppose you have your notes in English as I don't speak French?

Google Translate usually does a pretty good job with his pages, plus the commands will be universal.

TarFile 04-10-2016 11:04 PM

Well I gave Google Translate a try seems to have worked.

mralk3 04-11-2016 11:41 AM

I recently switched from VirtualBox to KVM + libvirt + qemu + virt-manager. It all seems to work really well. Bridging seems to work with my wireless NIC, which was something that never worked in the past for me.

I followed these docs: http://docs.slackware.com/howtos:gen...virt#resources


They are a bit outdated, but were a good starting point. Virt-manager makes it very easy to do everything Virtual Box did, and then some.

The next link was also helpful in understanding the internals of this software. It explains the non-GUI approach to using qemu.

http://karellen.blogspot.com/2013/12...with-qemu.html

TarFile 04-11-2016 03:51 PM

I use both VirtualBox and KVM + QEUM and now have the KVM + libvirt + qeum + virt-manager set up and working at least so far.

I got to redo the whole thing on my current box and see how that goes. Not really looking forward to that.


All times are GMT -5. The time now is 03:21 PM.