QEMU and GNOME Boxes

The GNOME people work on improving their DE constantly. We were always curious about their development of GNOME Boxes as it sounds promising to have a frontend for a QEMU instance or even use Boxes for creating that instance. Unfortunately, using Boxes as a replacement for creating a VM in KVM/QEMU via CLI does not work properly yet.

What are we going to do?

  • We are going to create a server on a physical machine for hosting virtual machines.
  • We then install another Ubuntu server on the virtual machine.
  • We will access the VM by using an SSH tunnel for connecting to the VNC server on that machine.
  • By doing so, we will make use of GNOME Boxes for accessing the console of the VM.

Let’s assume our IP-address is 10.0.0.10 on the dedicated VM Host. In this demo, we are working inside an DHCP and DNS network, so the master server can easily handle the DNS records and host names. We simply fire up our server configuration, add the host name vmprovider for our dedicated VM machine and set the IP 10.0.0.10. Thus we can access our server via SSH more comfortably and/or are not bound to using IP addresses in the browser. This is helpful when you e.g. work on a Wordpress setup for instance. Wordpress doesn’t like changing IP addresses.

Why are we going to do this?

There are many reasons for deploying virtual machines on a server. Working on a local machine sometimes just doesn’t cut it, especially when you’re short on RAM or when cooperating with your fellow colleagues on a project.
Also, solutions like VMWare Player or Virtualbox are nice, but they also eat up your resources quickly. Yes, they’re hungry.

Using LXC is quite cool, but what if you don’t want to risk anything and find it to be a hassle to set up the LXC stuff, doing the config and so on? Cloning an LXC container is simple, but still you have to configure the networking and so on.

  1. Do you also find it terribly annoying when the VM instance captures your mouse pointer? GNOME Boxes doesn’t do that.
  2. Do you hate configuring the video settings for not messing up the scaling of your VM window? Simply resize your box.

Good Guy GNOME

What do we need?

Ubuntu 14.04 Server ISO
For the sake of simplicity we are renaming the file to just ‘ubuntu1404.iso’. My suggestion is to do that on your local machine for saving time.

Server

20 GB HD space
1 free CPU
1 GB RAM

reasonable hostname and user names

  • vmprovider for our host machine
  • vmuser

Desktop with a GNOME DE >=3.10
GNOME Boxes

What we’re not going to cover here

bridging your NICs
There are various tutorials across the web. It’s not too difficult to do, so we just take it for granted to work with virbr0 and its IP 192.168.122.1.

the perfect KVM/QEMU configuration
This post is about making use of GNOME Boxes via VNC, not about KVM’s huuuge options library.

the perfect network configuration
Why would we handle the network configuration inside a VM hosting machine while we could easily do that on a machine which’s purpose is to provide our users with a great environment? Nope.

Install the VM Host

Start the installation process on your dedicated machine, but do not just hit the Enter button furiously. Instead, press the ESC button on the language selection screen first, then hit F4 and select ‘Minimal Installation’. Why? Because we want to create a lean and slick server installation. Apart from that, the minimal Installation downloads lots of necessary packages from the web so you save your time for doing a dist-upgrade after you’ve completed the installation procedure.

Partition your hard drives simply with the guided LVM setup and apply the reasonable user and host name, continue the install process. When reaching the tasksel screen, select the Basic Ubuntu server, the SSH server and the VM provider packages. Finish the installation process and reboot your VM host. We now SSH onto our machine and use the terminal rather than the VM’s console.

You’ll need some additional packages for making your life more comfortable. We don’t want to use QEMU, but we will use virsh as it provides us with a selection of simple options.

[email protected]

sudo apt-get install virtinst libvirt-bin

Preparation time

From our local machine we are copying the Ubuntu image to the /home folder of our vmuser on the VM host machine by using scp:

[email protected]

scp ~/Downloads/ubuntu1404.iso [email protected]:/home/vmuser/ubuntu1404.iso

Of course, you could easily browse the vmprovider’s file system by accessing it via Nautilus, so we could go with “connect to server”

[email protected]

ssh://vmprovider #ssh://10.0.0.10

and filling in our credentials.

On the VM Hoster edit the qemu config file for making the output of the VM’s VNC server accessible to VNC clients:
[email protected]

sudo nano /etc/libvirt/qemu.conf

Find the line vnc_listen and uncomment it:

[email protected]

vnc_listen = "0.0.0.0"

By doing so, any client from anywhere can access your VM’s console output, so we strongly suggest you have set up your access rules properly on a master server which handles DNS, DHCP and stuff. (refer to the section ‘What we’re not going to cover here’)

You don’t have to create a virtual file system prior to the installation process, we are going to do that while installing the VM Guest.

Finally start the installation!

SSH onto the vmprovider and fire up virsh in all of its glory:

[email protected]

virt-install —connect qemu:///system -n ubuntu2 -r 1024 —vcpus=1 —arch=x86_64 -c ~/ubuntu1404.img —network=network:default,mac=00:AA:BB:CC:DD:00 —accelerate —vnclisten=0.0.0.0 —disk=/var/lib/libvirt/images/ubuntu2,size=20 —force
ubuntu2 is the name of your environment, call it according to your needs
—vnclisten=0.0.0.0 is not necessary here as already defined in the qemu.conf file
/var/lib/../ubuntu2 is the name of your virtual disk, make sure to keep same name like above
—force means that you force the installation into this folder and file

It can become quite cumbersome to restart installation procedures when receving errors, because you have to delete the environments, remove the MAC addresses and so forth.

[email protected]

virsh destroy ubuntu2
virsh undefine ubuntu2

standard procedure to memorize

Step One start the instance
Step Two SSH tunnel
Step Three start GNOME Boxes
No. It won’t work out if you don’t follow the order of launching the instance and then starting Boxes.

Wait for the install process to begin and then create a tunnel from your local machine to the vmprovider by launching a terminal and typing:

[email protected]

ssh [email protected] -L5900:127.0.0.1:5900

Now you can launch Boxes and create a new box. Well, you could have created the box beforehand but why hurry? You don’t have to specify a port in Boxes since you already have specified the correct port in your tunnel plus you enter the standard port for the VNC protocol by: vnc://127.0.0.1

Your box is ready now. Double click it to access the console and continue the installation. Did you read the section above about not furiously hitting the Enter button? Yes, we like that option, so we’ll do it again and select ‘Minimal Virtual Installation’ now. By doing so, Ubuntu does not install all the kernel modules and drivers which do not come in use in a virtual setup. How cool is that? We love it.

Once you’re done with the installation, your box will become dark. Let it rest for a while until you’re sure the installation process has completed properly. Sometimes it ‘freezes’, but you can easily stop the process by applying the shortcut given in the terminal window.
Close your box for now. Then go to your terminal (not the tunneling one!) and list all your installed machines:

[email protected]

virsh —connect qemu:///system list —all

Now is the time for starting up the machine again:

[email protected]

virsh —connect qemu:///system start ubuntu2

Again, make sure having started the instance before starting your GNOME Box. It won’t connect and your Tunnel Terminal will give you an error output. Voilá, there we go. We now can do what we want to do. Create a Rails application by installing RVM, running GitLab or whatever you like. Testing and wrecking.

Once you’ve had enough, you can shut down your instance by
[email protected]
sudo init 0

in your VM Guest session or on your VM Host

[email protected]

virsh —connect qemu:///system shutdown ubuntu2

Done with playing, now close that tunnel!

Alright, there you go. On your local machine grep for the processes involved with VNC:

[email protected]

ps aux | grep 5900

Then kill them!
[email protected]

kill 1680 #the PID given above

OK, OK. A more reasonable way? Close the Tunnel Terminal by hitting
[email protected]
CTRL + D

Questions and different stuff

Obviously, you can find different configuration options and might be wondering why we do it that way. First of all – why not?

> Why do you place the virtual disk inside /var/…?

Out of a habit. Usually I have my /var directory on a separate partition so that I can easily mount it during a server upgrade process without the need for repartitioning and other hassles which simply consume my time. (refer to the section ‘What we’re not going to cover here’)

> What if I want to run several virtual machines on my vmprovider?

Just make sure not to run out of CPUs and RAM. Simply alter your install command and apply this little neat option to it:

[email protected]

—vnclisten=0.0.0.0,port=5901

Of course you have to change the ports in your tunnels and of GNOME Boxes accordingly:
vnc://127.0.0.1:5901

> I have grepped for 5900 and there are still processes running!

No need to worry. These show up on changing ports and do no harm.

> I am not absolutely sure if my tunnel is closed?

Fire at will!

[email protected]

pkill -x ssh

Still questions? Comments?

Did we make any mistake? Do you find it stupid to fuzz around with QEMU? Tell us why! Suggestions and improvements? Hit the ‘comment’ button or leave a reply on Google+!

Christopher Semmler's picture

Christopher Semmler

Christopher Semmler is our CEO and works in our IT and Finance Division. Apart from Business Development he makes technology decisions, works on platforms and Digital Marketing. He holds a Magister degree in Corporate Finance and Information Systems, loves to play with new tech and is specialised in the low level area.

Comments

  1. David Allen's picture
    David Allen (not verified)

    The framework engineering has the same sum of if not more potential to represent the deciding moment the client encounter. Outline choices made at the least levels as a regulation rise to roll out the most basic improvements to the client meet. Write Me an Essay One basic illustration is the document frame. A low level alter from a progressive non-forming document framework to a level metadata-driven completely formed record skeleton would clearly change the client bump into essentially.

  1. jahatloh's picture
    jahatloh (not verified)

    Mantenha o excelente trabalho, eu li alguns artigos neste site e acho que seu blog na web é realmente interessante e poder para as pessoas de informações excelentes. 1. Jasa SEO 3. Jasa Pembuatan Website Google Url Shortener

  1. Alex Sam's picture
    Alex Sam (not verified)

    Overwhelming metal doesn't have screamers, metalcore does as most metal kinds vocalists do have the particular capacity to deliver the sound that they need like the demise snarl, video making companies. yelled or melodic. Relies on upon the music. On the off chance that you going the metalcore course there's getting a keyboardist all things considered they aren't generally important unless the individual is okay as they can wind up simply being another instrument playing what the other 3 are doing..

  1. Earl Anderson's picture
    Earl Anderson (not verified)

    QEMU is a machine emulator and virtualizer. As a machine emulator, it can run OSes and programs made for one machine (e.g. an ARM board) on a different machine (e.g. your own PC). As a virtualizer, QEMU achieves near native performance by executing the guest code directly on the host CPU using KVM. KVM (Kernel-based Virtual Machine) is a Linux kernel module that allows a user space program to use the hardware virtualization features of various processors. Clickable Link 

  1. Anonymous's picture
    Anonymous (not verified)

    Yes they are Gnomes do exists however they exists in the soul world or astral plane in truth elves have been outstanding everywhere throughout the world for instance in Hawaii they are Mani Huni's. custom essay help. These spirits are resealed as Elemental creatures since Gnomes compare to the component of earth.

  1. Monroe Alfred's picture
    Monroe Alfred (not verified)

    We could all wear "hanging with the knomies" tee shirts in support. Knomes are little and famously smart and this one is very much voyage. animated video services. Jack is an awesome specialist and we could put little Jack heads on our auto attenaes for support.

  1. Peter Kevin's picture
    Peter Kevin (not verified)

    I essentially need to offer immense thankful for this stunning post of Write my assignment at Assignmentland.com, quality article and will look a more fundamental measure of your assembled captivating substance. Magnificent sharing!

  1. James Anderson's picture
    James Anderson (not verified)

    This is one of the most informative and educational posts of On Time Papers. Actually, I'm searching this kind of material. Thank you so much for sharing this post.

  1. Martin Jam's picture
    Martin Jam (not verified)

    This is a very informative article of Do My Assignment from AssignmentKeen.com. I also agree with your post title and your really well explain your point of view. I am very happy to see this post. Thanks for share with us. Keep it up and share the more most related post.

  1. James Cameron's picture
    James Cameron (not verified)

    Ubuntu is free and open basis programming, which income customers are allowed to run, copy, appropriate, pay to do my homework study, and enhance the product under the terms.

  1. Google's picture
    Google (not verified)
  1. Kristine Stevart's picture
    Kristine Stevart (not verified)

    It’s pleasant to spectator such remarkable writing skills. 9/10 for this write-up. Our corporation is in UK Essays sector and provides best quality essays result at your doorstep.

  1. jennifer nicole's picture
    jennifer nicole (not verified)

    I simply need to express profound gratitude for this awesome post of www.dissertationmill.co.uk, quality article and will look a greater amount of your separate entrancing substance. Brilliant sharing!

  1. Solomon Daniel's picture
    Solomon Daniel (not verified)

    I likewise concur with your post title and your truly well clarify your perspective. I am exceptionally glad to see this post. A debt of gratitude is in order for offer with us. Keep it up and share the all the more most related post. There are not a considerable measure of occasions where things were named as weeds. Helpful links for Homework

  1. Mathew Hayden's picture
    Mathew Hayden (not verified)

    I basically need to offer significant thanks for this marvelous post, I moreover agree with your post title and your really well clear up your point of view. I am astoundingly happy to see this post. An obligation of appreciation is all together for offer with us. Do my Essay for me

  1. Robert's picture
    Robert (not verified)

    This is an exceptionally enlightening article, I am astoundingly glad to see this post. A commitment of gratefulness is all together for offer with us. Much obliged to you such a great amount for sharing this post.Buy Essay

  1. enough's picture
    enough (not verified)

    Nice blog, the article you have shared is good.This article is very useful. My friend suggest me to use this blog.
    Top Management college in chandigarh

  1. jordansaq's picture
    jordansaq (not verified)

    yeezy350find When I saw your article, especially this post you satisfied me amazingly.

  1. susan richard's picture
    susan richard (not verified)

    We hope to release them within the next weeks, buy assignment online as we require taking a shot at our Jenkins arrangement for Continuous addition and Deployment.

  1. 1len jordanss123's picture
    1len jordanss123 (not verified)
  1. buy assignment online's picture
    buy assignment ... (not verified)

    Many thanks for sharing this very diverse opinion post where each expert has no doubt shared his best knowledge on the topic. Have more success in your journey. Buy Assignment online to Get A+ Grades

  1. Amanda Huss's picture
    Amanda Huss (not verified)

    The technology is cumulative and latest gear is getting intended to forecast the earthquake happening earlier only. But, still we can see the destruction producing by these natural disasters. As per they investigation intelligences available in custom dissertation writers blog says that in every quake produced till now there is huge human lose in tremors.

  1. jasie's picture
    jasie (not verified)

    google [url=http://www.google.com/]google[/url]

  1. Peter Kevin's picture
    Peter Kevin (not verified)

    The author has made a stunning article UK Essay Writing Service. You made you show up and neighboring no exchange about. Unmistakably this specific empower that you to can not fight with the truth is not wide, everything has its staggering case. A dedication of gratefulness is all together for this information.

  1. david963's picture
    david963 (not verified)

    The technology is cumulative and latest gear is getting intended to forecast the earthquake happening earlier only. But, still we can see the destruction producing by these natural disasters.. IT Experts Agency, Technical Support & IT Solutions Darsenizami

  1. james963's picture
    james963 (not verified)

    The technology is cumulative and latest gear is getting intended to forecast the earthquake happening earlier only. But, still we can see the destruction producing by these natural disasters.. IT Experts Agency, Technical Support & IT Solutions it solutions

  1. david963's picture
    david963 (not verified)

    Nice blog, the article you have shared is good.This article is very useful. My friend suggest me to use this blog.. find out latest styles dresses for women with wide variety of famous brands in cheap rates at dresses for women .

  1. torento's picture
    torento (not verified)

    DPS has a very good hostel for the students where they get homely environment. Students of various age groups and different places live in the hostel.
    Boarding School in Rajasthan

  1. Leah Poulton's picture
    Leah Poulton (not verified)

    Unix is a proprietorial operating system to which exceptional essay help – Essayhelpdeal.co.uk corporations very own the rights. Every and each corporations model of unix is especially exceptional yet they all comply with the comparable standards as a fashion to make it common to circulate functions among special model. Linux is an open supply working equipment designed to be nicely suited with the unix standards. Correctly linux basically but any other model of unix. This isn't technically well ideal but near sufficient for plenty circumstances.

  1. MELANIE	's picture
    MELANIE (not verified)

    Paragraf deduktif adalah paragraf yang dimulai dengan mengemukakan persoalan pokok atau kalimat topik kemudian diikuti dengan kalimat-kalimat penjelas. Contoh:undangan pernikahan klub bola Agen Welded Beam T beam King Queen Cross Castellated Beam undangan pernikahan cetak Pabrik besi cnp baja Agen Plat Besi Hitam undangan pernikahan Agen Jual Besi Siku Baja Agen Bondek Cor Agen Atap Spandek Sni Toko besi beton psi Ulir Polos Distributor besi cnp baja Distributor besi cnp baja undangan pernikahan klasik Distributor besi h beam baja Agen Plat Kapal Bki Krakatau Steel undangan pernikahan amplop surat Agen Besi Unp Baja Profil Kanal Distributor Stainless steel Agen Plat Bordes Kembang Toko besi beton perwira Harga besi cnp baja Harga besi cnp baja undangan pernikahan cantik elegan jual laptop asus jual laptop asus jual laptop asus murah jual laptop asus murah Harga besi h beam baja jasa konstruksi baja undangan pernikahan simple Agen Besi Cnp Profil Baja Gording Supplier Stainless steel Distributor besi cnp baja Toko besi beton PAS Jual besi cnp baja Jual besi cnp baja undangan pernikahan custom Jual besi h beam baja www.pusatbesibaja.co.id undangan pernikahan murah Agen Besi Hollow Agen Stainless steel Harga besi cnp baja Toko besi beton master steel ms Supplier besi cnp baja Supplier besi cnp baja undangan pernikahan cute Supplier besi h beam baja www.pusatbesibaja.com undangan pernikahan unik Agen Wiremesh Toko Stainless steel Jual besi cnp baja Toko besi beton ksty Toko besi cnp baja Toko besi cnp baja undangan pernikahan coklat Toko besi h beam baja www.jualbesibajamurah.com undangan pernikahan biasa Agen Besi Pipa Baja Schedule 80 Jual Stainless steel Supplier besi cnp baja Toko besi beton krakatau steel Agen besi cnp baja Agen besi cnp baja undangan pernikahan cantik dan murah Agen besi h beam baja Agen besi beton Sni Ulir Polos polos ulir undangan pernikahan bunga Agen Besi Pipa Baja Schedule 40 Harga Stainless steel Toko besi cnp baja Toko besi beton jcac Pabrik besi cnp baja Pabrik besi cnp baja undangan pernikahan casual Pabrik besi h beam baja Agen besi beton sii undangan pernikahan artis Agen Pipa Besi Hitam Medium Pabrik Stainless steel Agen besi cnp baja Toko besi beton interworld steel is Distributor besi h beam baja Distributor besi h beam baja undangan pernikahan contoh Distributor plat besi hitam Agen besi beton psi Ulir Polos undangan pernikahan modern Agen Besi Wf Distributor Baja Ringan Distributor Wiremesh Besi Toko besi beton gunung garuda Harga besi h beam baja Harga besi h beam baja undangan pernikahan chinese Harga plat besi hitam Agen besi beton perwira undangan pernikahan artis Agen Besi H beam Supplier Baja Ringan Harga Wiremesh Besi Toko besi beton delcoprima Jual besi h beam baja Jual besi h beam baja undangan pernikahan cantik Jual plat besi hitam Agen besi beton PAS undangan pernikahan casual Agen Besi Beton Agen Baja Ringan Jual Wiremesh Besi Toko besi beton cakra steel cs Supplier besi h beam baja Supplier besi h beam baja undangan pernikahan bunga Supplier plat besi hitam Agen besi beton master steel ms undangan pernikahan animasi www.sentrabesibaja.com Toko Baja Ringan undangan pernikahan simple undangan pernikahan murah Supplier Wiremesh Besi Toko besi beton bjku Toko besi h beam baja Toko besi h beam baja undangan pernikahan bentuk dompet Toko plat besi hitam Agen besi beton ksty undangan pernikahan murah Toko Welded Beam T beam King Queen Cross Castellated Beam Jual Baja Ringan Toko Wiremesh Besi Toko besi beton Sni Ulir Polos Agen besi h beam baja Agen besi h beam baja undangan pernikahan buatan sendiri Agen plat besi hitam Agen besi beton krakatau steel undangan pernikahan biru Toko Bondek Cor Harga Baja Ringan Agen Wiremesh Besi Toko besi beton ais Pabrik besi h beam baja Pabrik besi h beam baja undangan pernikahan batik Pabrik plat besi hitam Agen besi beton jcac undangan pernikahan arab Toko Atap Spandek Sni Pabrik Baja Ringan Pabrik Wiremesh Besi Toko besi beton link10

  1. well17's picture
    well17 (not verified)

    Moonlight Films and Theatre Studio operates under the Moonlight Films and Theatre Society , a non-profit association whose goals are to spread knowledge of and interest in theatrical and media arts through education.
    Acting classes in Delhi
    Weekend Filmmaking
    Filmmaking workshop in delhi
    and Take One School of Mass Communication considered as a part of the Top Mass Communication Colleges in India. It was set up in the year 2003 by honing media experts who met with a mutual vision of giving a stage to the adolescent of the nation.
    Best mass communication college in Delhi
    Journalism courses in Delhi

  1. Words Doctorate 's picture
    Words Doctorate (not verified)

    Thank you very much for this wonderful site. well written and informative content you have. PhD Thesis Writing Services

  1. Hero Instinct's picture
    Hero Instinct (not verified)

    Thank you for your post, I look for such article along time, today i find it finally. this post give me lots of advise it is very useful for me. Hero Instinct

  1. Health Benefits of Avocado's picture
    Health Benefits... (not verified)

    I feel very grateful that I read this. It is very helpful and very informative and I really learned a lot from it. Health Benefits of Avocado

  1. Health Benefits of Maca Root's picture
    Health Benefits... (not verified)

    Hi to everybody, here everyone is sharing such knowledge, so it’s fastidious to see this site, and I used to visit this blog daily Health Benefits of Maca Root

  1. dermis aesthetic's picture
    dermis aesthetic (not verified)

    I was taking a gander at some of your posts on this site and I consider this site is truly informational! Keep setting up.. dermis aesthetic

  1. David Mitchell's picture
    David Mitchell (not verified)

    If you want to make your server portal you can use Ubuntu as the operating system on the other hand. Window 10 is the best for all the operation. Both operating systems have their own value in their aspects. Essay Writers

  1. Deepawali Shayari's picture
    Deepawali Shayari (not verified)

    Deepawali Shayari - दीपावली शायरी Well, it’s a nice one, I have been looking for. Thanks for sharing such informative stuff. http://rkalert.in/deepawali-romantic-love-shayari

  1. Deepawali Shayari - दीपावली शायरी's picture
    Deepawali Shaya... (not verified)

    Deepawali Shayari - दीपावली शायरी Well, it’s a nice one, I have been looking for. Thanks for sharing such informative stuff. Deepawali shayri

  1. दीपावली बधाई शायरी 2017 's picture
    दीपावली बधाई शा... (not verified)

    दीपावली बधाई शायरी 2017 - Deepawali Message and shayari The blog article very surprised to me! Your writing is good. In this I learned a lot! Thank you! दीपावली बधाई शायरी 2017

  1. Deepawali Laxmi Poojan 's picture
    Deepawali Laxmi... (not verified)

    Deepawali Laxmi Poojan - दीवाली लक्ष्मी पूजन I really appreciate this wonderful post that you have provided for us. I assure this would be beneficial for most of the people.. Deepawali Laxmi Poojan

Add comment