Tag Archive | debian wheezy

KVM virtualization with Debian GNU/Linux in 7 steps

1. Install required packages

# apt-get install bridge-utils kvm

2. Create an empty kvm virtual machine image:

# kvm-img create vm.qcow2 -f qcow2 20G

3. Prepare a bridge so you can attach to it the net interface of your vm.

3a. Setup your eth0 interface to capture all the traffic:

# ifconfig eth0 promisc up

3b. Create the bridge interface:

# brctl addbr br0

3c. Put your eth0 interface in the bridge (so it captures all the wire traffic and sends it to all the others interfaces in the bridge and vice-versa):

# brctl addif br0 eth0

4. Restore your network connection by the br0 interface (optional)

4a. Bring up your bridge interface and give to it an address (so you can use it as your ip address):

# ifconfig br0 <your_ip> <your_netmask> up

4b. Remember to restore your default gateway:

# ip route add default via <gateway_ip>

5. Start your virtual machine (-boot d to install Debian from the ~/iso/debian.iso image, optional)

# kvm -hda vm.qcow2 -cdrom ~/iso/debian.iso -boot d -net nic,vlan=0 -net tap,vlan=0,ifname=tapvm

6. Add tap interface of vm to your bridge

# brctl addif br0 tapvm

7. Enable forwarding and tell to iptables to allow tapvm traffic to flow through your pc

# sysctl -w net.ipv4.ip_forward=1
# iptables -A FORWARD -m physdev --physdev-out tapvm -j ACCEPT
# iptables -A FORWARD -m physdev --physdev-in tapvm -j ACCEPT

Debian Squeeze/Wheezy (6.0/7.0) and Xerox Unified Driver v. 7-15

Xerox Unified Driver works very well and you can install it without any problem from console or by the X (gui) wizard. At the moment it doesn’t support officialy Debian >=6.0 (it supports old Debian 3.1, 4.0, 5.0 32/64bit) so this isn’t a real bug in fact but it can be a problem if you use squeeze/wheezy.

insserv: warning: script 'K07smfpd' missing LSB tags and overrides
insserv: warning: script 'smfpd' missing LSB tags and overrides
insserv: There is a loop at service rmnologin if started
insserv: There is a loop between service rmnologin and mountnfs if started
insserv:  loop involving service mountnfs at depth 6
insserv:  loop involving service nfs-common at depth 5
insserv: There is a loop between service rmnologin and checkroot if started
insserv:  loop involving service checkroot at depth 3
insserv:  loop involving service mountdevsubfs at depth 2
insserv: Starting smfpd depends on rmnologin and therefore on system facility `$all' which can not be true!
(...)
insserv: Starting smfpd depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Max recursions depth 99 reached
insserv:  loop involving service portmap at depth 4
insserv: There is a loop between service rmnologin and pcmcia if started
insserv:  loop involving service pcmcia at depth 2
insserv:  loop involving service udev at depth 1
insserv:  loop involving service module-init-tools at depth 4
insserv:  loop involving service mountnfs-bootclean at depth 8
insserv:  loop involving service exim4 at depth 8
insserv: There is a loop between service rmnologin and mountoverflowtmp if started
insserv:  loop involving service mountoverflowtmp at depth 3
insserv:  loop involving service mountall-bootclean at depth 2
insserv:  loop involving service avahi at depth 8
insserv: There is a loop between service rmnologin and ifupdown if started
insserv:  loop involving service ifupdown at depth 5
insserv:  loop involving service ifupdown-clean at depth 4
insserv:  loop involving service fuse at depth 11
insserv:  loop involving service networking at depth 7
insserv:  loop involving service mountall at depth 5
insserv:  loop involving service checkfs at depth 4
insserv: There is a loop between service rmnologin and ifupdown-clean if started
insserv: There is a loop at service smfpd if started
insserv:  loop involving service smfpd at depth 1
insserv:  loop involving service hwclockfirst at depth 4
insserv:  loop involving service hostname at depth 5
insserv: There is a loop between service rmnologin and mountall if started
insserv:  loop involving service mtab at depth 7
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header

To solve this problem you can:

  1. uninstall Xerox Unified Driver, update your system or install your software and then reinstall the Xerox driver
  2. “If your MFP device is not connected to LPT port, you can safely disable execution of this script” so remove /etc/init.d/smfpd (and its symlinks) from your init.d and rc.X folders
  3. Recommended: “LSBize” the init script to fix the problem (http://wiki.debian.org/LSBInitScripts). Add these lines to your /etc/init.d/smfpd (at EOF is ok because position is not important, so you can also use a combo of cat /patch >> /etc/init.d/smfpd if you want to fix it automatically) create a new file named smfpd in /usr/share/insserv/overrides/ with the following content:
    ### BEGIN INIT INFO
    # Provides:          smfpd
    # Required-Start:    $syslog
    # Required-Stop:     $syslog
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: Xerox Unified Linux Driver LPT Support daemon
    # Description:       Enable support for LPT port service provided by Xerox Unified Linux Driver package.
    ### END INIT INFO

And just request support for Debian -6.0- 7.0 😉

update 2011-08-12: there is another minor bug in install.sh at line 1187 because –reload_rules is wrong, change it to –reload-rules
update 2013-06-14: mmmm, Xerox didn’t fix, so I’ve updated my post for Debian Wheezy 7.0
update 2013-07-02: thanks to darac’s comment I’ve learned a better way to do the work: put an override file in /usr/share/insserv/overrides/ as indicated by insserv man page