Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

AQemu Virtual Machine Installatioin

Here you can discuss every aspect of Debian. Note: not for support requests!
Message
Author
oldschool1
Posts: 10
Joined: 2016-06-18 16:58

AQemu Virtual Machine Installatioin

#1 Post by oldschool1 »

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.

User avatar
ralph.ronnquist
Posts: 342
Joined: 2015-12-19 01:07
Location: Melbourne, Australia
Been thanked: 6 times

Re: AQemu Virtual Machine Installatioin

#2 Post by ralph.ronnquist »

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
habu
Posts: 63
Joined: 2016-03-13 09:07

Re: AQemu Virtual Machine Installatioin

#3 Post by habu »

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
ralph.ronnquist
Posts: 342
Joined: 2015-12-19 01:07
Location: Melbourne, Australia
Been thanked: 6 times

Re: AQemu Virtual Machine Installatioin

#4 Post by ralph.ronnquist »

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.

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

Re: AQemu Virtual Machine Installatioin

#5 Post by pcalvert »

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
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

User avatar
gradinaruvasile
Posts: 935
Joined: 2010-01-31 22:03
Location: Cluj, Romania
Contact:

Re: AQemu Virtual Machine Installatioin

#6 Post by gradinaruvasile »

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.

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

Re: AQemu Virtual Machine Installatioin

#7 Post by pcalvert »

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
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

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

Re: AQemu Virtual Machine Installatioin

#8 Post by oldschool1 »

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?

User avatar
ralph.ronnquist
Posts: 342
Joined: 2015-12-19 01:07
Location: Melbourne, Australia
Been thanked: 6 times

Re: AQemu Virtual Machine Installatioin

#9 Post by ralph.ronnquist »

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

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

Re: AQemu Virtual Machine Installatioin

#10 Post by oldschool1 »

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.

User avatar
ralph.ronnquist
Posts: 342
Joined: 2015-12-19 01:07
Location: Melbourne, Australia
Been thanked: 6 times

Re: AQemu Virtual Machine Installatioin

#11 Post by ralph.ronnquist »

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.

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

Re: AQemu Virtual Machine Installatioin

#12 Post by oldschool1 »

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.

User avatar
ralph.ronnquist
Posts: 342
Joined: 2015-12-19 01:07
Location: Melbourne, Australia
Been thanked: 6 times

Re: AQemu Virtual Machine Installatioin

#13 Post by ralph.ronnquist »

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
gradinaruvasile
Posts: 935
Joined: 2010-01-31 22:03
Location: Cluj, Romania
Contact:

Re: AQemu Virtual Machine Installatioin

#14 Post by gradinaruvasile »

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
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: AQemu Virtual Machine Installatioin

#15 Post by GarryRicketson »

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.

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

Re: AQemu Virtual Machine Installatioin

#16 Post by oldschool1 »

Ralph and Garry,

I got the info regarding risk of installing on hard drive here: http://virt-tools.org/learning/install- ... mand-line/

"File, logical volume or SAN? Storing the disk as a plain host file is the easiest option. As long as you have enough free space, you can put the file anywhere, and move it around later. However file access isn't very fast, so for the best performance you should choose an LVM2 logical volume (LV) or (if you have it) a dedicated LUN on your SAN storage. Using a host partition or host disk directly is not recommended for security reasons."

I assumed because any malware could more easily gain access to your hard drive if the vm were stored there, perhaps wrongly. Since I don't have a SAN, USB stick seemed logical. I am perfectly happy to leave it on my hard drive though if there indeed isn't much risk, and to enable file sharing.

Ralph, I don't have time this second to try your instructions. I will get to it later and report.

Regarding gnome3, can't say I am a big fan, but I was using Ubuntu (was turned off when they started sharing private searches with Amazon without telling anyone) and then Linux Mint, only to discover that Mint embedded flash into the OS or so appeared to me, with a file called mintflash or something like that. I remove all flash off my hard drive as a matter of habit and then install it on a virtual machine for security and privacy reasons. When i removed mintflash, Mint broke... Debian now seems the most secure, private, and supportable Linux distribution to me, and gnome seems most respectful of individual privacy and greeny friendly (again to me), so I can put up with the gnomish behavior, but this might be an argument for another thread.

I very much appreciate your help.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: AQemu Virtual Machine Installatioin

#17 Post by GarryRicketson »

Hmm, interesting, I looked at the link as well.
I suppose there is nothing wrong with being extra care full, they don't really go into details
as to why the "security reasons",...
I think that might depend somewhat on exactly what you are doing with the VM,
and especially if the host is a Windows, machine.
I suppose it might be a little bit safer, if one was booting with the USB stick, and running the VM from that. However, a lot of the windows "mal-ware" or "viruses"
still can migrate from a usb stick ,to the HD, But any way I suppose that also is another
topic.

User avatar
ralph.ronnquist
Posts: 342
Joined: 2015-12-19 01:07
Location: Melbourne, Australia
Been thanked: 6 times

Re: AQemu Virtual Machine Installatioin

#18 Post by ralph.ronnquist »

Using a host partition or host disk directly is not recommended for security reasons.
That sentence refers to the idea of using a raw partition or whole disk rather than a file as virtual disk. And while I agree to the sentiment of avoiding it, "security" wouldn't be high on my list of reasons. Except that such a solution almost implies that the VM has to be run as root, which generically would be a security concern.

I would choose a virtual disk file for convenience, and that's fastest on the fastest file system of course. Maybe it'd be faster as an LVM partition (or maybe not), but certainly that'd be less convenient.

User avatar
Francewhoa
Posts: 32
Joined: 2013-04-12 17:59
Location: Sept-Iles, Quebec, Canada
Has thanked: 6 times

Re: AQemu Virtual Machine Installatioin

#19 Post by Francewhoa »

Optionally, to automatically mount a 9pfs folder at Guest boot, if your Debian uses systemd, the 9p powered mount will be too fast and likely fail. To resolve this challenge, I suggest adding this line to the "fstab" file. Which is located at "/etc/fstab":

Code: Select all

/<HOST PATH> /<GUEST PATH>/<MOUNT FOLDER>	9p	noauto,x-systemd.automount,x-systemd.device-timeout=10,timeo=14,x-systemd.idle-timeout=0,trans=virtio,version=9p2000.L,rw	0	0
Attribution and thanks to Fryderyq for this
- - -
Loving back your Debian community result in multiple benefits for you. https://www.debian.org/intro/help

arzgi
Posts: 1185
Joined: 2008-02-21 17:03
Location: Finland
Been thanked: 31 times

Re: AQemu Virtual Machine Installatioin

#20 Post by arzgi »

Maybe things are a bit different than 7 years ago :roll:

Post Reply