AQemu Virtual Machine Installatioin

Here you can discuss every aspect of Debian. Note: not for support requests!

AQemu Virtual Machine Installatioin

Postby oldschool1 » 2016-06-18 17:06

I am new to Debian. I came from Ubuntu. I am trying to get virtual machines installed. I first tried Virtualbox without luck. I then decided to try AQEMU. I installed it. I can get to the gui controlling the vm's. When I try to install a new VM using the wizard it seems to create a VM without a boot option? I just want to create another debian VM on it. Something that should be basic and easy, follow the creation wizard and then click start on VM and it starts, turns out to be quite complex while I am trying to figure out why it won't boot. I did try using the templates, same result.

I would very much appreciate any help.
oldschool1
 
Posts: 10
Joined: 2016-06-18 16:58

Re: AQemu Virtual Machine Installatioin

Postby ralph.ronnquist » 2016-06-18 18:31

More recently I started using libvirt-clients for VM's. Very easy to use, and I believe it has a management GUI as well (although I don't use that).
User avatar
ralph.ronnquist
 
Posts: 320
Joined: 2015-12-19 01:07
Location: Melbourne, Australia

Re: AQemu Virtual Machine Installatioin

Postby habu » 2016-06-18 18:33

i don’t understand that virtualbox did not install for you haw you read these wiki
https://wiki.debian.org/VirtualBox#Debian_8_.22J
debian-8.8
Lenovo Thinkpad: Intel(R) Core(TM) i7-3610QM
CPU 2.30GHz amd64
User avatar
habu
 
Posts: 63
Joined: 2016-03-13 09:07

Re: AQemu Virtual Machine Installatioin

Postby ralph.ronnquist » 2016-06-19 05:54

For virtual machines other than VirtualBox, my start point was at https://wiki.debian.org/KVM, although following https://wiki.debian.org/VirtualNetworking for (host only) networking, and https://wiki.debian.org/HowTo/dnsmasq for its DHCP.

It has resulted in installing packages:
= qemu-kvm and libvirt-bin as virtualization platform,
= virtinst and libvirt-clients for installing and running (virt-install for installing, and virsh + virt-viewer for running)
= vde2, uml-utilities and dnsmasq for host-side networking.

Creating VM's also involves manual once-over for the VM configuration, in ~/.config.libvirt/qemu/$VM.xml, to declare the network. I have forgotten where I found this magic, but it's merely a) to add the attribute
Code: Select all
xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0
to the domain tag, and then b) to add a sub node like the following to it:
Code: Select all
<qemu:commandline>
    <qemu:arg value='-net' />
    <qemu:arg value='nic,macaddr=52:54:00:5d:16:d6,addr=0x04' />
    <qemu:arg value='-net' />
    <qemu:arg value='vde,sock=/tmp/vde.ctl' />
</qemu:commandline>
Though, you'd change macaddr for each, and you can also use some other socket path for the vde_switch (/tmp/vde.ctl is its default).

The networking setup is not needed initially, as libvirt then uses special NAT-ing. There are also other networking options. I choose the vde2 approach so as to run both network and VM's as non-root, although some root access is needed to set up the tap and iptables masquerading, and for running dnsmasq (could be done as non-root user, I think).

EDIT: The host side networking is easily set up with a script like the following:
Code: Select all
#!/bin/bash
TAP=tap0
NET=192.168.55

# Create a tap for this user
sudo tunctl -t $TAP -u $USER

# Assign an IP address to the tap
sudo ifconfig $TAP $NET.1

# Start the VDE switch and detach from it
vde_switch -tap $TAP -daemon

# Start a dhcp service
DHCPARG=$NET.20,$NET.100,255.255.255.0,$NET.255
sudo dnsmasq -D -N -i $TAP -F $DHCPARG

# Define an iptables control function
iptablesrules() {
    sudo iptables $1 FORWARD -i $TAP -j ACCEPT
    sudo iptables $1 FORWARD -o $TAP -j ACCEPT
    sudo iptables -t nat $1 POSTROUTING -j MASQUERADE
}

# Toggle iptables rules (to avoid duplications)
iptablesrules -D
iptablesrules -A

Note that the script is run as non-root $USER, and it uses sudo for running certain commands as root.
User avatar
ralph.ronnquist
 
Posts: 320
Joined: 2015-12-19 01:07
Location: Melbourne, Australia

Re: AQemu Virtual Machine Installatioin

Postby pcalvert » 2016-06-19 20:10

oldschool1 wrote:I am trying to get virtual machines installed. I first tried Virtualbox without luck.

Try harder. I started with QEMU/KVM and later I tried VirtualBox to see how it compares. I now use VirtualBox almost exclusively. VirtualBox is much more user-friendly, and the performance seems quite good.

Phil
“Property is the fruit of labor; property is desirable; it is a positive good
in the world. That some should be rich shows that others may become
rich, and hence is just encouragement to industry and enterprise.”
— Abraham Lincoln
pcalvert
 
Posts: 1903
Joined: 2006-04-21 11:19
Location: Sol Sector

Re: AQemu Virtual Machine Installatioin

Postby gradinaruvasile » 2016-06-20 18:10

If you use kvm+libvirt+virt-manager, setting up and running VMs is just as easy as with virtualbox with no additional kernel module compilation (wich seems no big deal until you want to use a kernel that is not supported by VB). Also libvirt launches vms as a service, in background and it also natively supports remote management (including graphical console access, usb redirection etc) via ssh. Libvirt tracks machine states and automatically shuts them down on system shutdown and if set, starts them on system startup.
User avatar
gradinaruvasile
 
Posts: 935
Joined: 2010-01-31 22:03
Location: Cluj, Romania

Re: AQemu Virtual Machine Installatioin

Postby pcalvert » 2016-06-21 00:25

gradinaruvasile wrote:If you use kvm+libvirt+virt-manager, setting up and running VMs is just as easy as with virtualbox with no additional kernel module compilation (wich seems no big deal until you want to use a kernel that is not supported by VB).

Sounds good. Thanks for the info.

Phil
“Property is the fruit of labor; property is desirable; it is a positive good
in the world. That some should be rich shows that others may become
rich, and hence is just encouragement to industry and enterprise.”
— Abraham Lincoln
pcalvert
 
Posts: 1903
Joined: 2006-04-21 11:19
Location: Sol Sector

Re: AQemu Virtual Machine Installatioin

Postby oldschool1 » 2016-06-22 14:29

habu, I will have another look at that wiki and try again.

Ralph, thanks for the very detailed reply. However, I did go to the wiki page to follow those instructions and attempted to follow yours as well, which failed miserably.

For gtk-glade-2, which later error messages said I needed:
(synaptic:5287): GLib-CRITICAL **: g_child_watch_add_full: assertion 'pid > 0' failed
Gtk-Message: Failed to load module "canberra-gtk-module"
The gtk frontend needs a working python-gtk2 and python-glade2.
Those imports can not be found. Falling back to pager.
The error is: No module named glade
Gtk-Message **: Failed to load module "canberra-gtk-module" at /usr/lib/x86_64-linux-gnu/perl5/5.20/Gtk2.pm line 126, <> line 1.
Gtk-Message **: Failed to load module "canberra-gtk-module" at /usr/lib/x86_64-linux-gnu/perl5/5.20/Gtk2.pm line 126, <> line 1.
Selecting previously unselected package python-glade2.
(Reading database ... 168636 files and directories currently installed.)
Preparing to unpack .../python-glade2_2.24.0-4_amd64.deb ...
Unpacking python-glade2 (2.24.0-4) ...
Setting up python-glade2 (2.24.0-4) ...
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.61.240.89 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.61.240.89 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.61.240.89 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.61.240.89 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.61.240.89 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.61.240.89 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.61.240.89 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.61.240.89 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.233.100 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.233.100 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.233.100 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.233.100 80]

For Kemu-kvm:
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.236.52 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.236.52 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.236.52 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.236.52 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.233.100 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.233.100 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.233.100 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.233.100 80]

For libvert-bin:
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.61.240.89 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.61.240.89 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.61.240.89 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.61.240.89 80]

For vde2:
(synaptic:3571): GLib-CRITICAL **: g_child_watch_add_full: assertion 'pid > 0' failed
Gtk-Message: Failed to load module "canberra-gtk-module"
The gtk frontend needs a working python-gtk2 and python-glade2.
Those imports can not be found. Falling back to pager.
The error is: No module named glade
Gtk-Message **: Failed to load module "canberra-gtk-module" at /usr/lib/x86_64-linux-gnu/perl5/5.20/Gtk2.pm line 126, <> line 6.
Gtk-Message **: Failed to load module "canberra-gtk-module" at /usr/lib/x86_64-linux-gnu/perl5/5.20/Gtk2.pm line 126, <> line 6.
Selecting previously unselected package libvde0.
(Reading database ... 168260 files and directories currently installed.)
Preparing to unpack .../libvde0_2.3.2+r586-1_amd64.deb ...
Unpacking libvde0 (2.3.2+r586-1) ...
Selecting previously unselected package python-libvirt.
Preparing to unpack .../python-libvirt_1.2.9-1_amd64.deb ...
Unpacking python-libvirt (1.2.9-1) ...
Selecting previously unselected package python-urlgrabber.
Preparing to unpack .../python-urlgrabber_3.9.1-4.1_all.deb ...
Unpacking python-urlgrabber (3.9.1-4.1) ...
Selecting previously unselected package vde2.
Preparing to unpack .../vde2_2.3.2+r586-1_amd64.deb ...
Unpacking vde2 (2.3.2+r586-1) ...
Selecting previously unselected package virt-viewer.
Preparing to unpack .../virt-viewer_1.0-1_amd64.deb ...
Unpacking virt-viewer (1.0-1) ...
Selecting previously unselected package virtinst.
Preparing to unpack .../virtinst_1%3a1.0.1-5_all.deb ...
Unpacking virtinst (1:1.0.1-5) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for desktop-file-utils (0.22-1) ...
Processing triggers for gnome-menus (3.13.3-6) ...
Processing triggers for mime-support (3.58) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for shared-mime-info (1.3-1) ...
Unknown media type in type 'all/all'
Unknown media type in type 'all/allfiles'
Unknown media type in type 'uri/mms'
Unknown media type in type 'uri/mmst'
Unknown media type in type 'uri/mmsu'
Unknown media type in type 'uri/pnm'
Unknown media type in type 'uri/rtspt'
Unknown media type in type 'uri/rtspu'
Setting up virt-viewer (1.0-1) ...
update-alternatives: using /usr/bin/spice-xpi-client-remote-viewer to provide /usr/bin/spice-xpi-client (spice-xpi-client) in auto mode
Setting up libvde0 (2.3.2+r586-1) ...
Setting up python-libvirt (1.2.9-1) ...
Setting up python-urlgrabber (3.9.1-4.1) ...
Setting up vde2 (2.3.2+r586-1) ...
Setting up virtinst (1:1.0.1-5) ...
Processing triggers for libc-bin (2.19-18+deb8u4) ...
Processing triggers for python-support (1.0.15) ...
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb

With final message:
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.236.52 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.236.52 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.236.52 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.236.52 80]

For uml-utilities
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]

(synaptic:4507): GLib-CRITICAL **: g_child_watch_add_full: assertion 'pid > 0' failed
Gtk-Message: Failed to load module "canberra-gtk-module"
The gtk frontend needs a working python-gtk2 and python-glade2.
Those imports can not be found. Falling back to pager.
The error is: No module named glade
Gtk-Message **: Failed to load module "canberra-gtk-module" at /usr/lib/x86_64-linux-gnu/perl5/5.20/Gtk2.pm line 126, <> line 1.
Gtk-Message **: Failed to load module "canberra-gtk-module" at /usr/lib/x86_64-linux-gnu/perl5/5.20/Gtk2.pm line 126, <> line 1.
Selecting previously unselected package uml-utilities.
(Reading database ... 168604 files and directories currently installed.)
Preparing to unpack .../uml-utilities_20070815-1.4_amd64.deb ...
Unpacking uml-utilities (20070815-1.4) ...
Processing triggers for systemd (215-17+deb8u4) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up uml-utilities (20070815-1.4) ...
Processing triggers for systemd (215-17+deb8u4) ...
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]
--- final message
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 128.30.2.26 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.236.52 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.236.52 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.236.52 80]
W: Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
404 Not Found [IP: 64.50.236.52 80]

I don't think I did anything unusual when installing this version of debian, in case that is helpful.

Any ideas now?
oldschool1
 
Posts: 10
Joined: 2016-06-18 16:58

Re: AQemu Virtual Machine Installatioin

Postby ralph.ronnquist » 2016-06-23 07:50

Hmm. You probably need to first install/enable "multiarch".. https://wiki.debian.org/Multiarch
I think it'd be the following commands as root:
Code: Select all
# dpkg --add-architecture i386
# apt-get update
User avatar
ralph.ronnquist
 
Posts: 320
Joined: 2015-12-19 01:07
Location: Melbourne, Australia

Re: AQemu Virtual Machine Installatioin

Postby oldschool1 » 2016-06-24 16:55

Ralph,

Added i386 then update. That seemed to install all necessary packages. I reinstalled the ones you mentioned just to be sure, and without error. So, thanks for the help there.

Next, I went back to AQEMU and created new linux 2.6 from template box. However, there is not bootable device. So, how do I create a bootable device?

Thanks in advance.
oldschool1
 
Posts: 10
Joined: 2016-06-18 16:58

Re: AQemu Virtual Machine Installatioin

Postby ralph.ronnquist » 2016-06-25 00:07

I have been using virt-install to define machines and install their OS-es; several different ones including both Debian and Devuan as well as WIndows XP, FreeDOS and ForthOS. You'll have to google details of virt-install, but I can show you one of my installations as an example:
Code: Select all
#!/bin/bash
ARGS=(
    --name debian84
    --os-variant debianwheezy
    --memory 2048
    --disk path=$(pwd)/debian84.img,size=8
    --filesystem /home/ralph/share,/home/ralph/share
    --graphics spice
    --cdrom /home/ext/data/debian-8.4.0-amd64-netinst.iso
)
virt-install ${ARGS[@]}
This creates a debian84 "domain" (as it's called), which is a VM with Debian 8 based on a downloaded netinst CD image. As you might notice, this also sets up a shared folder between the host and the client, but that's of course very optional.

Next, when I want to run this, I'm using the following run script:
Code: Select all
#!/bin/bash
DOMAIN=debian84
HOTKEYS=--hotkeys=toggle-fullscreen=shift+f11,release-cursor=shift+f12
virt-viewer $HOTKEYS $DOMAIN &
virsh start $DOMAIN
The virt-viewer provides the GUI for the VM, which is started by virsh. The viewer can handle both vnc and spice, and as you might have noted about the install script, I've come to favour spice.

Onwards you control the VM with virsh.

Some or all of the above can probably be done via the virt-manager tool. I think I opted out of the tool due to it's gnome-ishness, and in any case, who needs a GUI for starting a VM?

The default networking works well for installing the VM. I then patched the configuration file as per earlier post, to run a host-only VDE network that handles any number of (well, many) concurrently running VMs. You may or may not want or need this. There are other documented ways of setting up networks (also supported by virt-manager, I think), but I couldn't use those without running the VMs as root.
User avatar
ralph.ronnquist
 
Posts: 320
Joined: 2015-12-19 01:07
Location: Melbourne, Australia

Re: AQemu Virtual Machine Installatioin

Postby oldschool1 » 2016-06-30 02:13

Ralph,

That is a little intimidating for me, so I guess I need a gui. hehe

I think I want to put the VM on a usb stick. One of the forums suggested it wasn't safe putting the VM on your hard drive?

Is there a way to do this with AQEMU using debian 8.4.0 amd64 1.iso?

Or, what would be the specific instructions using the above with a shared folder, if safe. I will take your word on spice.

Thanks.
oldschool1
 
Posts: 10
Joined: 2016-06-18 16:58

Re: AQemu Virtual Machine Installatioin

Postby ralph.ronnquist » 2016-06-30 04:34

Some forums give good advice, but that's not one of them. You also need a slightly richer ontology, because a virtual machine is just that -- it's virtual. It's physical presence is in a configuration file (or files), and its storage file (or files), and the emulation software, which makes the pretense of hardware. You wouldn't want the storage for a running machine held on a USB, because that would make it awfully slow. And it's certainly not "safer" in any way; I can't phatom what the line of argument might have been. From the host's perspective, the storage is just a file, which means at can be copied and moved. Though, the VM configuration files typically holds its pathname, so moving it may mean to change the configuration accordingly.

Anyhow, lets say you want to create a virtual machine with:
+ its single virtual disk at /media/usb/oldschool1VM.img, reserving 8 Gb space (the device obviously will need to cope with that),
+ 2 Gb of RAM (i.e., virtual RAM),
+ having the installation CD at hand as $HOME/Downloads/debian8.4.0-amd64-1.iso, and
+ sharing the hosts /shared folder as the /shared folder of the client
To do so, you can prepare the following installation script:
Code: Select all
#/bin/bash
ARGS=(
    --name oldschool1VM
    --os-variant debianwheezy
    --memory 2048
    --disk path=/media/usb/oldschool1VM.img,size=8
    --filesystem /shared,/shared
    --graphics spice
    --cdrom $HOME/Downloads/debian-8.4.0-amd64-1.iso
)
virt-install ${ARGS[@}}

The installation script is used only once to create the virtual machine. It is however useful to have as a script, because eventually you discover that there's something you would want differently, and then you can easily change and reuse it to create a new machine.

Assuming you named the installation script oldschool1VM-install.sh, you'd make it executable andrun it by:
Code: Select all
$ chmod a+x oldschool1VM-install.sh
$ ./oldschool1VM-install.sh


Running the script will create a configuration file in the libvirt sub system, as $HOME/.config/libvirt/qemu/oldschool1VM.xml, in henceforth you can use virsh to do stuff to it, referring to it as oldschool1VM. In the virsh documentation, oldschool1VM is called the "domain" to which you can fiddle with devices and whatnot. Good to know, but not interesting to you as yet.

Running the install script also starts the VM, and runs virt-viewer as the console viewer, and then it'll boot up the installation CD.

Eventually you power down the installed system. Then, to run it again, you use
Code: Select all
$ virt-viewer oldschool1VM &
which brings up a console viewer for that VM, and
Code: Select all
$ virsh oldschool1VM
to start the VM.

The folder sharing requires the additional step of mounting it within the guest. You can for instance add the following line to /etc/fstab
Code: Select all
/shared /shared 9p trans=virtio 0 2
after having made directory /shared, and ensured the 9p module is available. I don't remember if it's in the default setup, or if you need to apt-get something.

In all this, you'll get the "standard" hardware setup, including in particular the "user mode" network option, whereby the client attaches to the hosts external interface in some magic way that makes it invisible.

All very simple, and not a GUI in sight... eh, except the viewer of course.
Last edited by ralph.ronnquist on 2016-06-30 07:00, edited 1 time in total.
User avatar
ralph.ronnquist
 
Posts: 320
Joined: 2015-12-19 01:07
Location: Melbourne, Australia

Re: AQemu Virtual Machine Installatioin

Postby gradinaruvasile » 2016-06-30 06:34

There is a GUI for all these - it's called virt-manager. It can do most things virsh can in a VBox-like manner. You can build/manage your VMs without even touching virsh (may be for some really advanced stuff maybe but i never had the need to).
It also has built-in SPICE/VNC viewer. It can be used to connect to a remote libvirt instance and manage it just like yours.
User avatar
gradinaruvasile
 
Posts: 935
Joined: 2010-01-31 22:03
Location: Cluj, Romania

Re: AQemu Virtual Machine Installatioin

Postby GarryRicketson » 2016-06-30 13:51

I think I want to put the VM on a usb stick. One of the forums suggested it wasn't safe putting the VM on your hard drive?

I agree, I think that is a "myth".
There is no reason a VM would be dangerous or harmfull to the
HD.

In any event you could put one a USB stick, but it would not be practical. I wonder if the same forum that says
"it is not safe to have it on the HD" offers a tutorial or instruction to do that ?

I am not familiar with Qemu Virtual Machine, I use Virtual Box,.. so can not say much.
How ever, just logic , even if the VM is on the usb stick, you have to have the HD running
and use it access the usb stick, if there was anything on the VM that might harm the HD
it still could harm the HD via the USB port.
User avatar
GarryRicketson
 
Posts: 5872
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable