Check-in [2a5d9dafec]
Not logged in
Overview
Comment:Added debianization files
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2a5d9dafecacbff428750e8a1719fbc30cc1b1e5
User & Date: vitus on 2017-01-14 18:46:39
Other Links: manifest | tags
Context
2017-01-14
18:53
Added pandoc to build-depends. check-in: cca2dd7ce3 user: vitus tags: trunk
18:46
Added debianization files check-in: 2a5d9dafec user: vitus tags: trunk
17:24
Fixed some typos in make install check-in: 9bbf93f72b user: vitus tags: trunk
Changes

Added debian/README.Debian version [4db7afcc2b].



















































































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
vws for Debian
--------------

If you just want to download something into VM from outside world, you don't need bridge. Just use 'user' networking and it would be all. You can even access parts of host FS using SMB via user networking, although [vws] doesn't provide easy interface to this feature of QEMU.

But if you want to run web server on VM or use ssh to connect it, bridge is the way to go.

qemu-bridge-helper
------------------

As bridge is a network interface, root access is needed to manipulate it. QEMU includes small utility qemu-bridge-helper which is designed to be installed setuid root and perform just necessary operations.

Unfortunately, Debian package doesn't install this utility setuid root. So first thing you'll need to use bridge networking from qemu, started as normal user, is to make this utility setuid root.

chmod u+s /usr/lib/qemu/qemu-bridge-helper

Bee prepared that after upgrade of the qemu package, suid bit would be lost and your vms would fail to start until you fix it with command above.
Setting up bridge

In any linux system command

brctl addbr vm0

is used to create bridge interface vm0. After that this interface can be configured via ifconfig or ip command just like any other interface, dnsmasq could be run on it and iptables rules could be set.

But different linux distributions have different ways to automate this task so interface would be created at startup.
Debian and Ubuntu

You should add following to your /etc/network/interfaces:

auto vm0
iface vm0 inet static
     address 192.168.9.1
     network 192.168.9.255
     netmask 255.255.255.0
     bridge_ports none
     bridge_hw 11:22:33:44:55:66

(of course you can peek any number from 0 to 255 instead of 9 here for third octet of the IP. You can also use addresses from 10.0.0.0/8 or 172.16.0.0/12 instead of 192.168.0.0/16)

You need bridge_hw line (peek any unused mac address you want) because some recent versions of windows recognize bridge interface without static MAC as new network each time they boot.

Interface created this way would be totally isolated from outside world. This is probably not what you want, because you'll at least need to access software updates for your guest os. So, add following line:

post-up iptables -t nat -A POSTROUTING -s 192.168.9.0/24 -j MASQUERADE

and don't forget to enable ipv4 forwaring in the kernel.

Really it is enough for bridge configuration, if you don't mind to setup static IP for each of your VM manually. But using dnsmasq would save you great deal of effort if you have more then 2-3 virtual machine.

dnsmasq
-------

dnsmasq is a small dhcp and DNS server. If you would run it, it would act as caching DNS for your host machine and also provide IP Addresses for virtual machines and resolve their names.

You need to be sure that it servers DHCP only to your virtual bridge network, not to the physical network which connects you to internet, or it would conflict with dhcp server on your router and cause a mess.

So, you should have at least following lines in your dnsmasq.conf

no-dhcp-interface=eth0
domain=local.vm,192.168.9.0/24
dhcp-range=192.168.9.10,192.168.9.150,12h

First line specifies, that your ethernet interface shouldn't be served DHCP by dnsmasq. If your primary interface is wlan0 list it as no-dhcp-interface instead. If you have more than one physical network interface, repeat no-dhcp-interface line for each of them.

Second line tells dnsmask to tell virtual machines that they have local.vm domain (you may pick any other if you want)

And third line specifies range of addresses to give virtual machines, and time for which it this address is valid (12 hours).

Also add 192.168.9.1 into your /etc/hosts with name of you host and local.vm domain, and make sure that your resolv.conf points to local host (0.0.0.0 or 127.0.0.1 as nameserver) and lists local.vm domain in search statement.

With this setup you'll be able to access all your virtual machines using their hostnames, set up during guest OS installations.

When requesting IP from DHCP server they'll tell their hostnams, and dnsmasq would add DNS records to local.vm domain for each assigned address.

dnsmasq would also read your /etc/hosts and create dns records based on addresses and names listed here.

If your machine gets primary address and DNS server via DHCP, consult your distribution documentation, how to make your DHCP client to not pollute your resolv.conf and tell addresses of external DNS servers dnsmasq instead.

In Debian you'll need to install resolvconf package to simplify this task.

 -- Victor Wagner <vitus@wagner.pp.ru>  Sat, 14 Jan 2017 19:48:30 +0300

Added debian/README.source version [7d64ff91de].











1
2
3
4
5
6
7
8
9
10
+
+
+
+
+
+
+
+
+
+
vws for Debian
--------------

<this file describes information about the source package, see Debian policy
manual section 4.14. You WILL either need to modify or delete this file>



 -- Victor Wagner <vitus@wagner.pp.ru>  Sat, 14 Jan 2017 19:48:30 +0300

Added debian/changelog version [a24dad221c].






1
2
3
4
5
+
+
+
+
+
vws (0.5-1) unstable; urgency=low

  * Initial release 

 -- Victor Wagner <vitus@wagner.pp.ru>  Sat, 14 Jan 2017 19:48:30 +0300

Added debian/compat version [b6abd567fa].


1
+
9

Added debian/control version [1849bad438].






















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Source: vws
Section: otherosfs
Priority: optional
Maintainer: Victor Wagner <vitus@wagner.pp.ru>
Build-Depends: debhelper (>= 9), dh-systemd
Standards-Version: 3.9.5
Homepage: https://www.wagner.pp.ru/fossil/vws

Package: vws
Architecture: all
Depends: ${misc:Depends}, python,  qemu-system, bridge-utils, net-tools
Recommends: dnsmasq, virt-viewer
Description: Simple manger script for QEMU virtual machines
 Virtual Workstations (VWs) is simple and thin script layer that
 simplifies creation and use of KVM virtual machines. 
 .
 Only user-servicable parts inside.
 .
 VMs can be copied around using usial file operation, fine tuned using
 direct editing of QEMU command-line and controlled via QEMU monitor
 without interfering with easy to use wrapper scripts.

Added debian/copyright version [e98c4c337e].











































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: vws
Source: https://www.wagner.pp.ru/fossil/vws

Files: *
Copyright: 2015-2017 Victor Wagner <vitus@wagner.pp.ru>

License: GPL-3+
 This package is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 3 of the License, or
 (at your option) any later version.
 .
 This package is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 .
 You should have received a copy of the GNU General Public License
 along with this program. If not, see <http://www.gnu.org/licenses/>
 .
 On Debian systems, the complete text of the GNU General
 Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".

Files: debian/*
Copyright: 2017 Victor Wagner <vitus@wagner.pp.ru>
License: GPL-3+
 This package is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 3 of the License, or
 (at your option) any later version.
 .
 This package is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 .
 You should have received a copy of the GNU General Public License
 along with this program. If not, see <http://www.gnu.org/licenses/>
 .
 On Debian systems, the complete text of the GNU General
 Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".

Added debian/docs version [da39a3ee5e].

Added debian/files version [9cfdeb4817].


1
+
vws_0.5-1_all.deb otherosfs optional

Added debian/postinst version [d2611a031a].










































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#!/bin/sh
# postinst script for vws
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <postinst> `abort-remove'
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package


case "$1" in
    configure)
	update-rc.d vws defaults
	chmod u+s /usr/lib/qemu/qemu-bridge-helper
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0

Added debian/postrm version [cb1dacab3d].










































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#!/bin/sh
# postrm script for vws
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <postrm> `remove'
#        * <postrm> `purge'
#        * <old-postrm> `upgrade' <new-version>
#        * <new-postrm> `failed-upgrade' <old-version>
#        * <new-postrm> `abort-install'
#        * <new-postrm> `abort-install' <old-version>
#        * <new-postrm> `abort-upgrade' <old-version>
#        * <disappearer's-postrm> `disappear' <overwriter>
#          <overwriter-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package


case "$1" in
    purge)
		update-rc.d vws remove
	;;
	
	remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
    ;;

    *)
        echo "postrm called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0

Added debian/rules version [a8fba7c364].








































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#DH_VERBOSE = 1

# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
prefix=/usr
export prefix

# main packaging script based on dh7 syntax
%:
	dh $@
override_dh_build override_dh_auto_build:
	make prefix=/usr
override_dh_install override_dh_auto_install:
	make install prefix=/usr DESTDIR=`pwd`/debian/vws
	dh_systemd_enable
	dh_installinit
		
# debmake generated override targets
# This is example for Cmake (See http://bugs.debian.org/641051 )
#override_dh_auto_configure:
#	dh_auto_configure -- \
#	-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)




Added debian/source/format version [1064dc0ce2].


1
+
3.0 (quilt)

Added debian/source/options version [e677bc594d].


1
+
diff-ignore=\.fslckout