Tag Archives: linux

ReadyMedia multicast discovery on bridge iface

When running a ReadyMedia (aka MiniDLNA, but it could be the case for any application using multicast) server on a bridged interface (like br0), multicast_snooping must be disabled on the bridge:

echo 0 > /sys/devices/virtual/net/br0/bridge/multicast_snooping

to make the change permanent:

echo 'net.br0.bridge.multicast_snooping=0' > /etc/sysctl.d/98-minidlna_no_snoop.conf

References:

QGIS latest on Fedora stable

If you are looking for the latest version of QGIS for your stable Fedora installation (24 and 25 as writing) you can simply add my COPR repo: https://copr.fedorainfracloud.org/coprs/dani/QGIS-latest-stable/

sudo dnf copr enable dani/QGIS-latest-stable
sudo dnf install qgis

This repo includes the latest stable QGIS (backported from rawhide when available, otherwise built from scratch) with few changes.

Source of RPM packages can be found here: https://daniele.vigano.me/git/dani/copr-dani-qgis

CentOS 7 LXC container slow boot

After you have installed a CentOS 7 LXC template on a systemd supprted distro (Fedora 21/22, CentOS 7 with LXC 1.0.7), you can experience a ultra slow container boot (more than 5 minutes!). A small change can fix this issue.

In the container config (i.e. /var/lib/lxc/centos7/config) replace:

1
lxc.include = /usr/share/lxc/config/centos.common.conf

with

1
lxc.include = /usr/share/lxc/config/fedora.common.conf

This will make the container boot fast as it should be.

centos.common.conf is fine for CentOS 6 but not for CentOS 7: CentOS 7 is based on Fedora 19 and uses systemd, thus fedora.common.conf is the right config file to use.

Fedora 22 / CentOS 7 LXC fix systemd-journald process at 100%

Running a Fedora 21, Fedora 22 or a RHEL/CentOS 7 LXC container created by the lxc-create Fedora template can result in a 100% cpu loop for the systemd-journald process.

To fix this issue you must add lxc.kmsg = 0 to the container configuration. This can be done easily for all the Fedora templates in one shot:

echo "lxc.kmsg = 0" >> /usr/share/lxc/config/fedora.common.conf

See also:

Disable background updates on Fedora 21 / GNOME 3.14

If you use frequently a mobile internet connection with a monthly traffic limit, like me, you probably want control over automatic updates to avoid wasting traffic data.

GNOME 3.14 has a feature to automatically check for new updates using its gSoftware application. This feature can be disabled using the gsettings command line tool:

$ gsettings set org.gnome.software download-updates false

If you are not familiar with the terminal, also the graphical dconf-editor can be used.

First you need to install it:

$ sudo yum install dconf-editor

then, as normal user run it:

$ dconf-editor

now navigate to org.gnome.settings-daemon.software schema and un-tick the download-updates flag:

dconf-editor-updates

If you are using an older version of GNOME the schema is slight different. For Fedora 20/GNOME 3.10 you can take a look at this post http://worldofgnome.org/fedora-20-gnome-software-tips-and-tricks/.

Create a new Fedora LXC container using yum

In this tutorial we are going to install an LXC container with Fedora 21 to be run on a Fedora 21 host with libvirt. This can be used to create containers to be managed by my WebVirtMgr web panel.

Install the new filesystem

yum -y --installroot=/var/lib/libvirt/filesystems/fedora21 --releasever=21 --nogpg install systemd passwd yum fedora-release vim openssh-server procps-ng iproute net-tools dhclient less

Create the libvirt domain

virt-install --connect lxc:/// --name fedora21 --ram 512 --filesystem /var/lib/libvirt/filesystems/fedora21/,/

This command will also start the domain. Now it’s time to stop it and do some post install configurations.

Post-installation setup

Press Ctrl + ] to detach from the domain console. Than stop it:

virsh -c lxc:/// shutdown fedora21

Change root password

chroot /var/lib/libvirt/filesystems/fedora21 /bin/passwd root

Setup the hostname

echo "mynewlxc" > /var/lib/libvirt/filesystems/fedora21/etc/hostname

Setup the network

cat << EOF > /var/lib/libvirt/filesystems/fedora21/etc/sysconfig/network
NETWORKING=yes
EOF
cat << EOF > /var/lib/libvirt/filesystems/fedora21/etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=dhcp
ONBOOT=yes
DEVICE=eth0
EOF

Setup SSH

chroot /var/lib/libvirt/filesystems/fedora21/
ln -s /usr/lib/systemd/system/sshd.service /etc/systemd/system/multi-user.target.wants/
exit

Start the container

virsh -c lxc:/// start fedora21

Or, if you are using my WebVirtMgr web panel fork you can start / stop the domain using it.

The Fedora 21 LX

The Fedora 21 LXC

Source

Thanks to major.io for his original article. It contains also some important considerations about security.

WebVirtMgr with LXC support

This is the connections page backported from WebVirtMgr 4.8.7

https://github.com/daniviga/webvirtmgr/

WebVirtMgr (by retspen) is a simple but great libvirt frontend written in python with Django. It currently supports only KVM as hypervisor. However libvirt can be already used to manage other hypervisors (like XEN) and it also supports LXC containers.

Using the container libvirt feature I extended WebVirtMgr, creating a fork, which adds LXC support and other minor improvements (see https://github.com/daniviga/webvirtmgr/commits/master)

LXC support currently has some limitations:

  • The LXC container filesystem must be created manually (this is a libvirt limitation)
  • Even the LXC domain creation isn’t supported right now (you need to create the XML and define the domain manually, virt-install can be used)
  • Web remote console is under development and not yet ready (some work has been made using butterfly)
  • LXC domain deletion doesn’t remove its filesystem
  • Snapshotting is not supported (another libvirt limitation, it can be done manually with LVM or Btrfs)

But basic functions works well:

  • Management of remote hosts (via TCP, SSH, TLS, socket)
  • Start, stop, shutdown, pause
  • Autostart
  • CPU and RAM limits assignment
  • Network interfaces management
  • Clone (only the domain, filesystem must be copied manually)

My WebVirtMgr fork contains also some minor differences and improvements compared to the original:

  • The old connections list page (with a table instead of boxes) has been kept
  • It supports a very basic ACLs system (for both KVM and LXC). With this feature non-admin users can be created (using the django-admin interface) that can only have specific access to a pre-defined set of VMs/LXCs. This means that user “foo“, for example, can only start/stop/shutdown or access the remote console of the VM “my_vm

The installation procedure remains the same as the original project.

Screenshots

This is the connections page backported from WebVirtMgr 4.8.7

This is the connections page backported from WebVirtMgr 4.8.7

KVM instances

The KVM instances view

The LXC instances view

The LXC instances view

An example of a running LXC container

An example of a running LXC container

An LXC domain can be cloned, and a random MAC address can be generated

An LXC domain can be cloned, and a random MAC address can be generated

An example of an LXC deletion

An example of an LXC deletion

Instance admin interface: you can assign users

Instance admin interface: you can assign users

 Links

HP MicroServer G7 RAC and Linux

How to flash a new firmware and how to set the network remotely without rebooting.

Download the new firmware (version 1.4 as writing) from the HP website

The flashing utility SOCFLASH is available on the Aspeed website (direct link). The utility is available also for Linux both 32 and 64 bit.

Flash the new RAC firmware

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$ ./socflash.sh all.1.4.bin old.1.3.bin
ASPEED SOC Flash Utility v.1.09.04
Find ASPEED Device 1a03:2000 on 3:0.0
Relacate IO Base: e800
MMIO Virtual Address: 3e18000
Static Memory Controller Information:
CS0 Flash Type is SPI
CS1 Flash Type is NOR
CS2 Flash Type is SPI
Boot CS is 2
Option Information:
CS: 2
Flash Type: SPI
[Warning] Don\'t AC OFF or Reboot System During BMC Firmware Update!!
[SOCFLASH] Flash ID : 180101
Find Flash Chip #1: SpansionS25FL128 SE64KB
Backup Flash Chip O.K.
Check Flash Chip #1 at: 440000

Setup IPMI in the OS

1
2
$ modprobe ipmi_si type=kcs ports=0xca2
$ echo "ipmi_si type=kcs ports=0xca2" > /etc/modprobe.d/ipmi.conf

Change the network settings

1
2
3
4
5
6
7
8
9
10
$ ipmitool shell
ipmitool> lan set 1 ipsrc static
ipmitool> lan set 1 ipaddr 172.16.12.238
Setting LAN IP Address to 172.16.12.238
ipmitool> lan set 1 netmask 255.255.255.0
Setting LAN Subnet Mask to 255.255.255.0
ipmitool> lan set 1 defgw ipaddr 172.16.12.10
Setting LAN Default Gateway IP to 172.16.12.10
ipmitool> mc reset warm
Sent warm reset command to MC