tag:blogger.com,1999:blog-58453215159900163222024-03-19T11:05:40.297+00:00Linux/BSD: sharing experiencesNotes, tips, tutorials, how-tos, etc... All related to Unix-like OS namely FreeBSD and Linux.
My way of giving a bit back to the community. ;)tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.comBlogger135125tag:blogger.com,1999:blog-5845321515990016322.post-4433676336535131452016-03-07T14:02:00.001+00:002016-03-07T14:11:27.015+00:00Tip: Fixing mouse cursor theme in Atom window on CentOS 7.x<!DOCTYPE html><html><head><meta charset="utf-8"><title>Untitled Document.md</title><style></style></head><body id="preview">
<p>When hovering over the <a href="https://atom.io">Atom</a> window it is
visible that the mouse cursor doesn’t match the default GNOME desktop
environment mouse cursor theme, <code>Adwaita</code>.</p>
<p>X11 default mouse cursor is defined in <code>/usr/share/icons/default/index.theme</code>
and by a regular CentOS install is left to <code>dmz-aa</code>.</p>
<p>To have a coherent theme across GNOME GTK3 windows and Atom, change it the X11
theme to that of GNOME:</p>
<pre><code class="language-console"># sed -i <span class="hljs-string">'s/dmz-aa/Adwaita/g'</span> /usr/share/icons/<span class="hljs-keyword">default</span>/<span class="hljs-keyword">index</span>.theme
</code></pre>
</body></html>tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com0tag:blogger.com,1999:blog-5845321515990016322.post-66489014148396322582016-01-15T22:55:00.002+00:002016-01-15T22:58:03.591+00:00Tip: Fixing X201 monitor brightness dim on CentOS 7.x / GNOME 3.14.xThis one was driving me crazy...<br />
<br />
With a recent update (can't pinpoint which because I have the nasty habit of updating often but only rebooting once in a blue moon) my Lenovo X201 monitor started dimming the brightness after something that felt like 30s without input from mouse or keyboard.<br />
<br />
...sigh...<br />
<br />
This smelled like GNOME gsettings and after mucking around I found how to deal with the issue:<br />
<code>$ gsettings set org.gnome.settings-daemon.plugins.power idle-brightness 300</code><br />
<br />
Basically <span style="font-family: Courier New, Courier, monospace;">gsettings</span> can used to <span style="font-family: Courier New, Courier, monospace;">set</span> the key (I've choosen to change from the previous set <span style="font-family: Courier New, Courier, monospace;">30</span> to <span style="font-family: Courier New, Courier, monospace;">300</span> seconds) of a target schema (<span style="font-family: Courier New, Courier, monospace;">idle-brightness</span>) within the <span style="font-family: Courier New, Courier, monospace;">org.gnome.setting-daemon.plugins.power</span> schema directory.<br />
<br />
For more on <span style="font-family: Courier New, Courier, monospace;">gsettings</span>:
<ol class="code">
<li><code>$ man gsettings</li></code>
<li><code>$ gsettings help</li></code>
</ol>
</br>
Now wasn't that cool or what?</br>
</br>...sigh...
tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com0tag:blogger.com,1999:blog-5845321515990016322.post-4273315694585146292015-05-12T13:28:00.003+01:002015-05-12T14:51:26.109+01:00HowTo: Install Steam on CentOS7<a href="http://store.steampowered.com/about">Steam</a> for Linux is a reality for the past few years allowing access to an ever growing list of games including popular titles such as <a href="http://store.steampowered.com/app/440/?snr=1_5_9__205">Team Fortress 2</a>, Half-Life and Counter Strike.<br />
<br />
If in the past getting it installed on CentOS6 meant jumping through hoops with the latest major version of CentOS those issues have been overcome thanks to updated system libraries and the availability of repositories such as Nux Dextop that package Steam into a nice and friendly rpm.<br />
<br />
Basically to have Steam working on CentOS7 you'll need to execute a few steps:<br />
1) Enable Nux Dextop and EPEL repositories<br />
2) Install Steam<br />
3) Launch it<br />
4) Have fun<br />
<br />
In other words:
<br />
<br />
<ol class="code">
<li><code>$ su</code></li>
<li><code># rpm -Uvh http://ftp.up.pt/fedora-epel/7/x86_64/e/epel-release-7-5.noarch.rpm && rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm</code></li>
<li><code># yum install steam libgudev1.i686</code></li>
</ol>
<br />
As for step 4, I suggest installing <a href="http://store.steampowered.com/app/440/?snr=1_5_9__205">Team Fortress 2</a> :)<br />
<br />
Now launch Steam, go through the graphical install and provide your account credentials to login.<br />
<br />
As an off-topic side note, consider having a YUM plugin to manage repositories so that base CentOS packages aren't replaced by those from third-party repositories, personally I use <span style="font-family: Courier New, Courier, monospace;">protectbase</span>.tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com3tag:blogger.com,1999:blog-5845321515990016322.post-84006699422359106132012-10-25T22:41:00.000+01:002014-03-27T14:20:44.291+00:00HowTo: Xen 4.1.3 Windows 8 HVM domU with Intel HD4000 VGA Passthrough on Debian Wheezy<b><i>Update 05/07/2013:</i></b><br />
<i>Despite the HowTo being close to 1 year it applies perfectly to this day. At the time Wheezy was Debian's Testing distribution and has since moved to Stable. Much of it can be used to setup other HVM domU such as Linux. </i><br />
<br />
<i><u><b>Important notice:</b></u> I've experienced some problems with xen-hypervisor-4.1-amd64 versions 4.1.4-3+deb7u1_amd64 and 4.1.4-3_amd64 which implement some security advisory patches . As a result to have sucessful passthrough I was forced to go back to the previous working version: 4.1.4-2_amd64 which is available at http://www.xen.org/downloads/XCP/debian/repo/amd64/xen-hypervisor-4.1-amd64_4.1.2-2.1_amd64.deb. Again, do notice that this package is missing some security patches available in more recent versions.</i><br />
<i> </i> <br />
In this HowTo I'll present the steps required to install <a href="http://xen.org/">Xen</a> 4.1.3 using the <a href="http://manpages.debian.net/cgi-bin/man.cgi?query=xm&apropos=0&sektion=0&manpath=Debian+testing+wheezy&format=html&locale=en"><span style="font-family: "Courier New",Courier,monospace;">xm</span></a> toolstack on a <a href="http://www.debian.org/releases/testing/">Debian Wheezy</a> (kernel 3.2.0-3-amd64) dom0, create a Windows 8 <span id="goog_1858344919"></span><a href="http://www.blogger.com/">HVM<span id="goog_1858344920"></span></a> domU config and setup VGA/PCI Passthrough for the integrated GPU, USB 2.0 controller and audio.<br />
<br />
This HowTo assumes that the reader is comfortable with Linux and Windows operating systems namely Debian GNU/Linux and Windows 7/8 as such it doesn't cover the operating systems installation.<br />
<br />
For easier reference the procedure will broken down in the following steps:<br />
1) Hardware requirements<br />
2) Install Xen on Debian Wheezy<br />
3) Configure networking<br />
4) Configure Xen<br />
5) Prioritise Xen boot<br />
6) Create and install Windows 8 HVM domU<br />
7) Assign devices for PCI Passthrough<br />
8) Install GPLPV drivers<br />
9) Advices and impressions <br />
<br />
<h3>
1) Hardware requirements</h3>
For PCI passthrough both motherboard and CPU must support <a href="http://download.intel.com/technology/computing/vptech/Intel(r)_VT_for_Direct_IO.pdf">VT-d</a> also know as <a href="http://en.wikipedia.org/wiki/IOMMU">IOMMU</a> IO virtualization.<br />
<br />
The hardware used to write this HowTo setup is composed of:<br />
<ul>
<li>Intel Core i7-3770 CPU, </li>
<li>Intel DQ77MK Motherboard,</li>
<li>32GB GEIL DDR3 1600 MHz,</li>
<li>200GB Maxtor SATA HDD,</li>
<li>Samsung SyncMaster 940BW Monitor.</li>
</ul>
<br />
It should be noted that VT-d and <a href="http://en.wikipedia.org/wiki/VT-d#Intel_virtualization_.28VT-x.29">VT-x</a> have been enabled in the motherboard and that the i7-3770 integrated GPU is the computer's sole GPU.<br />
<br />
In addition to the above setup I've also used another networked computer so I could SSH into the dom0 and perform the steps identified bellow.<br />
<br />
<h3>
2) Install Xen on Debian Wheezy</h3>
The Xen hypervisor is provided by the <a href="http://packages.debian.org/wheezy/xen-linux-system-amd64"><span style="font-family: "Courier New",Courier,monospace;">xen-linux-system</span></a> package:<br />
<br />
<ol class="code">
<li><code>$ su</code></li>
<li><code># apt-get update</code></li>
<li><code># apt-get install xen-linux-system</code></li>
</ol>
<br />
<h3>
3) Configure networking</h3>
There are several ways you can provide network access to domU guest domains, the most common being setting up a network bridge which I'll be covering.<br />
<br />
To assign a static IP to the dom0 and define a network bridge named eth0, disable <a href="http://manpages.debian.net/cgi-bin/man.cgi?query=NetworkManager&apropos=0&sektion=0&manpath=Debian+testing+wheezy&format=html&locale=en"><span style="font-family: "Courier New",Courier,monospace;">NetworkManager</span></a> (if installed) and edit <a href="http://manpages.debian.net/cgi-bin/man.cgi?query=interfaces&apropos=0&sektion=0&manpath=Debian+testing+wheezy&format=html&locale=en"><span style="font-family: "Courier New",Courier,monospace;">/etc/network/interfaces</span></a> to contain a bridge:<br />
<br />
<ol class="code">
<li><code># /etc/init.d/network-manager stop</code></li>
<li><code># update-rc.d network-manager disable</code></li>
<li><code># aptitude install bridge-utils</code></li>
<li><code># vim /etc/network/interfaces</code>
<code>auto lo br0</code>
<code>iface lo inet loopback</code>
<code>allow-hotplug eth0</code>
<code>iface eth0 inet manual</code>
<code>iface br0 inet static</code>
<code>bridge_ports eth0</code>
<code>address 192.168.1.5</code>
<code>broadcast 192.168.1.255</code>
<code>netmask 255.255.255.0</code>
<code>gateway 192.168.1.254</code></li>
<li><code># vim /etc/resolv.conf</code>
<code>domain my.domain.com</code>
<code>nameserver 192.168.1.254</code></li>
</ol>
<br />
<span style="font-family: "Courier New",Courier,monospace;">192.168.1.5</span> is the IP chosen to be assigned to the host, <span style="font-family: "Courier New",Courier,monospace;">192.168.1.255</span> and <span style="font-family: "Courier New",Courier,monospace;">255.255.255.0</span> are the typical <span style="font-family: "Courier New",Courier,monospace;">broadcast</span> and <span style="font-family: "Courier New",Courier,monospace;">netmask</span> values for a <span style="font-family: "Courier New",Courier,monospace;">192.168.1.x</span> network and in my case the <span style="font-family: "Courier New",Courier,monospace;">gateway</span> is <span style="font-family: "Courier New",Courier,monospace;">192.168.1.254</span>. Replace this values according to your own network settings and desires.<br />
<br />
<h3>
4) Configure Xen</h3>
The <span style="font-family: "Courier New",Courier,monospace;">xend</span> daemon employs <a href="http://manpages.debian.net/cgi-bin/man.cgi?query=xend-config.sxp&apropos=0&sektion=0&manpath=Debian+testing+wheezy&format=html&locale=en"><span style="font-family: "Courier New",Courier,monospace;">xend-config.sxp</span></a> to determines the parameters that Xen should use.<br />
<br />
Personally I choose to disable dom0 ballooning, define the dom0 assignable memory and change the keyboard layout (I've changed mine to <span style="font-family: "Courier New",Courier,monospace;">pt</span>):<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># vim /etc/xen/xend-config.sxp</code>
<code>(dom0-min-mem 2048)</code>
<code>(enable-dom0-ballooning no)</code>
<code>(keymap 'pt')</code></li>
</ol>
<br />
I've restricted the amount of memory assigned to dom0 to 2048 MB. In my case the dom0 is headless and all the hard work is to be done by the non-privileged virtual machines as such I've opted for a comfortable amount of memory to be assigned to the dom0, 2048 MB (2 GB). To this end GRUB needs to pass the appropriate command as the hypervisor boots:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># echo 'GRUB_CMDLINE_XEN="dom0_mem=2G,max:2G"' >> /etc/default/grub</code></li>
<li><code># update-grub2</code></li>
</ol>
<br />
<br />
<h3>
5) Prioritise Xen boot</h3>
By default Wheezy's GRUB lists and boots regular kernels and afterwards the Xen hypervisor.<br />
<br />
Assuming that the computer is to be running Xen all the time it advisable to change this behaviour and increase Xen's GRUB boot priority so that it's the first on the list and boots by default.<br />
<br />
The Debian way to do this is to used <a href="http://manpages.debian.net/cgi-bin/man.cgi?query=dpkg-divert&apropos=0&sektion=0&manpath=Debian+testing+wheezy&format=html&locale=en"><span style="font-family: "Courier New",Courier,monospace;">dpkg-divert</span></a> like so:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># dpkg-divert --divert /etc/grub.d/08_linux_xen --rename /etc/grub.d/20_linux_xen</code></li>
<li><code># update-grub2</code></li>
</ol>
<br />
To undo this necessary:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># dpkg-divert --rename --remove /etc/grub.d/20_linux_xen</code></li>
<li><code># update-grub2</code></li>
</ol>
<br />
<br />
<h3>
6) Create and install Windows 8 HVM domU</h3>
The <span style="font-family: "Courier New",Courier,monospace;">xm</span> toolstack uses configuration files that define the domain meaning that we need to create a configuration file for our guest VM:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
.indent1 { padding-left: 1em; }
.indent2 { padding-left: 2em; }
.indent3 { padding-left: 3em; }
.indent4 { padding-left: 4em; }
.indent5 { padding-left: 5em; }
.indent6 { padding-left: 6em; }
</style>
<br />
<ol class="code">
<li><code># vim /etc/xen/win8-x64.cfg</code>
<code>kernel = 'hvmloader'</code>
<code>builder = 'hvm'</code>
<code>vcpus = '4'</code>
<code>memory = '4096'</code>
<code>disk = ['file:/srv/xen/domains/win8-x64.img,hda,w',</code><br /> <code>'file:/srv/xen/images/Windows8-ReleasePreview-32bit-English.iso,hdc:cdrom,r']</code>
<code>name = 'win8-x64'</code>
<code>vif = [ 'mac=00:16:3E:51:20:4C,bridge=br0,model=e1000' ]</code>
<code>on_poweroff = 'destroy'</code>
<code>on_reboot = 'restart'</code>
<code>on_crash = 'restart'</code>
<code>boot = 'dc'</code>
<code>acpi = '1'</code>
<code>apic = '1'</code>
<code>viridian = '1'</code>
<code>xen_platform_pci='1'</code>
<code>sdl = '0'</code>
<code>vnc = '1'</code>
<code>vnclisten = '0.0.0.0'</code>
<code>vncpasswd = ''</code>
<code>stdvga = '0'</code>
<code>usb = '1'</code>
<code>usbdevice = 'tablet'</code><code></code></li>
</ol>
<br />
Do note that a MAC address must be assigned to the virtual interface. The 00:16:3e MAC block is reserved for
Xen domains, do the last three digits may be randomly filled in (hex
values 0-9 and a-f only).<br />
<br />
In this HowTo I'm using file based storage which implies using the <span style="font-family: Courier New, Courier, monospace;">dd</span> command to create what will be the domU hard drive. To create a 40GB <span style="font-family: Courier New, Courier, monospace;">.img</span> file:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># dd if=/dev/zero of=/srv/xen/domains/win8-x64.img bs=1M count=40960</code></li>
</ol>
<br />
If you're using LVM use <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">'phy:/dev/mapper/win8-x64,hda,w'</span> (change according to your own target logical volume) instead of <span style="font-family: "Courier New",Courier,monospace;">'file:/srv/xen/domains/win8-x64.img,hda,w'</span>.<br />
<br />
For more on the options that the domain configuration file accepts refer to <a href="http://manpages.debian.net/cgi-bin/man.cgi?query=xmdomain.cfg&apropos=0&sektion=0&manpath=Debian+6.0+squeeze&format=html&locale=en">xmdomain.cfg</a>.<br />
<br />
There are 2 options when it comes to actually installing Windows 8 on the virtual machine. One method consists in using VNC to connect to the guest virtual machine and installing the operating system from whatever computer you have with a graphical desktop environment. In alternative, one can use VGA Passthrough for the install process altogether.<br />
<br />
Choose one of the methods, though the VNC method is preferable as it eases troubleshooting and it's the one documented bellow. To use the VGA Passthrough method jump to step 7 of the HowTo and issue <span style="font-family: "Courier New",Courier,monospace;">xm create win8-x64.cfg</span>.<br />
<br />
After defining Windows 8 domU configuration file execute it and connect through VNC to install Windows 8:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># xm create win8-x64.cfg</code></li>
<li><code>$ vncviewer 192.168.1.5</code></li>
</ol>
<br />
If running a GUI on dom0 simply <span style="font-family: "Courier New",Courier,monospace;">vncviwer 127.0.0.1</span>, however if running from a networked computer replace the localhost with the IP of the said networked computer (<span style="font-family: "Courier New",Courier,monospace;">192.168.1.5</span> for example).<br />
<br />
Proceed to do a Windows install, shutdown the guest VM and backup the .img for future use. To shutdown the Windows 8 HVM domU either use guest's shutdown button or issue:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># xm destroy win8-x64</code></li>
</ol>
<br />
<span style="font-family: "Courier New",Courier,monospace;">xm list</span> can be used to find out the domain Id and use it as argument for <span style="font-family: "Courier New",Courier,monospace;">xm destroy</span>, for example:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>xm list</code><code>Name ID Mem VCPUs State Time(s)</code><code>Domain-0 0 4096 8 r----- 34476.9</code><code>win8-x64 4 4096 4 -b---- 301.0</code></li>
<li><code>xm destroy 4</code></li>
</ol>
<br />
Also comment out the cdrom line so that the virtual machine doesn't boot into the Windows installation cdrom every time it boots. For security reasons it is best to disable VNC.<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
.indent1 { padding-left: 1em; }
.indent2 { padding-left: 2em; }
.indent3 { padding-left: 3em; }
.indent4 { padding-left: 4em; }
.indent5 { padding-left: 5em; }
.indent6 { padding-left: 6em; }
</style>
<br />
<ol class="code">
<li><code># vim /etc/xen/win8-x64.cfg</code>
<code>kernel = 'hvmloader'</code>
<code>builder = 'hvm'</code>
<code>vcpus = '4'</code>
<code>memory = '4096'</code>
<code>disk = ['file:/srv/xen/domains/win8-x64.img,hda,w',</code><br /> <b><code>#'file:/srv/xen/images/Windows8-ReleasePreview-32bit-English.iso,hdc:cdrom,r']</code></b>
<code>name = 'win8-x64'</code>
<code>vif = [ 'mac=00:16:3E:51:20:4C,bridge=br0,model=e1000' ]</code>
<code>on_poweroff = 'destroy'</code>
<code>on_reboot = 'restart'</code>
<code>on_crash = 'restart'</code>
<code>boot = 'dc'</code>
<code>acpi = '1'</code>
<code>apic = '1'</code>
<code>viridian = '1'</code>
<code>xen_platform_pci='1'</code>
<code>sdl = '0'</code>
<b><code>vnc = '0'</code></b> <code>vnclisten = '0.0.0.0'</code> <code>vncpasswd = ''</code>
<code>stdvga = '0'</code>
<code>usb = '1'</code>
<code>usbdevice = 'tablet'</code><code></code></li>
</ol>
<br />
<h3>
7) Assign devices for PCI Passthrough</h3>
A domU can be made aware and directly access and use PCI devices with full privileges. To accomplish that the PCI devices need to be hidden from the dom0 and not be forwarded to any other domUs.<br />
<br />
Using the <span style="font-family: "Courier New",Courier,monospace;">xm</span> toolstack this is achieved loading the <a href="http://cateee.net/lkddb/web-lkddb/PCI_STUB.html"><span style="font-family: "Courier New",Courier,monospace;">pci_stub</span></a> kernel module, identifying the PCI devices that are to be forwarded, unbinding the device from dom0 and bind it to <span style="font-family: "Courier New",Courier,monospace;">pci_stub</span> thus allowing it to be assigned in the domU config file.<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># lspci</code>
<code>00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller (rev 09)</code>
<b> <code>00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (rev 09)</code></b>
<code>00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)</code>
<code>00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)</code>
<code>00:16.3 Serial controller: Intel Corporation 7 Series/C210 Series Chipset Family KT Controller (rev 04)</code>
<code>00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)</code>
<code>00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)</code>
<b><code>00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)</code></b>
<code>00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4)</code>
<code>00:1c.6 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 7 (rev c4)</code>
<b><code>00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)</code></b>
<code>00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev a4)</code>
<code>00:1f.0 ISA bridge: Intel Corporation Q77 Express Chipset LPC Controller (rev 04)</code>
<code>00:1f.2 SATA controller: Intel Corporation 7 Series/C210 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)</code>
<code>00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)</code>
<code>02:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection</code>
<code>03:03.0 FireWire (IEEE 1394): LSI Corporation FW322/323 [TrueFire] 1394a Controller (rev 70)</code></li>
</ol>
<br />
I'll be forwarding <span style="font-family: "Courier New",Courier,monospace;">00:02.0 VGA compatible controller</span>, <span style="font-family: "Courier New",Courier,monospace;">00:1b.0 Audio device</span> and <span style="font-family: "Courier New",Courier,monospace;">00:1d.0 USB controller</span>. To know the exact numbering of the devices run <span style="font-family: "Courier New",Courier,monospace;">lspci -n</span>:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># lspci -n</code>
<code>00:00.0 0600: 8086:0150 (rev 09)</code> <b><code>00:02.0 0300: 8086:0162 (rev 09)</code></b>
<code>00:14.0 0c03: 8086:1e31 (rev 04)</code>
<code>00:16.0 0780: 8086:1e3a (rev 04)</code>
<code>00:16.3 0700: 8086:1e3d (rev 04)</code>
<code>00:19.0 0200: 8086:1502 (rev 04)</code>
<code>00:1a.0 0c03: 8086:1e2d (rev 04)</code>
<b><code>00:1b.0 0403: 8086:1e20 (rev 04)</code></b>
<code>00:1c.0 0604: 8086:1e10 (rev c4)</code>
<code>00:1c.6 0604: 8086:1e1c (rev c4)</code>
<b><code>00:1d.0 0c03: 8086:1e26 (rev 04)</code></b>
<code>00:1e.0 0604: 8086:244e (rev a4)</code>
<code>00:1f.0 0601: 8086:1e47 (rev 04)</code>
<code>00:1f.2 0106: 8086:1e02 (rev 04)</code>
<code>00:1f.3 0c05: 8086:1e22 (rev 04)</code>
<code>02:00.0 0200: 8086:10d3</code>
<code>03:03.0 0c00: 11c1:5811 (rev 70)</code>
</li>
</ol>
<br />
For each PCI to be forwarded create a <span style="font-family: "Courier New",Courier,monospace;">pci-stub</span> Id, unbind it from the dom0 and bind to <span style="font-family: "Courier New",Courier,monospace;">pci-stub</span>. <span style="font-family: "Courier New",Courier,monospace;">xm pci-list-assignable-devices</span> is useful in confirming if the device has been added to the pool of devices that can be assigned to a guest domain.<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># modprobe pci_stub</code></li>
<li><code># echo "8086 1e26" > /sys/bus/pci/drivers/pci-stub/new_id</code></li>
<li><code># echo "0000:00:1d.0" > /sys/bus/pci/devices/0000\:00\:1d.0/driver/unbind</code></li>
<li><code># echo "0000:00:1d.0" > /sys/bus/pci/drivers/pci-stub/bind</code></li>
<li><code># xm pci-list-assignable-devices</code>
<code>0000:00:1d.0</code></li>
<li><code># echo "8086 0162" > /sys/bus/pci/drivers/pci-stub/new_id</code></li>
<li><code># echo "0000:00:02.0" > /sys/bus/pci/devices/0000\:00\:02.0/driver/unbind</code></li>
<li><code># echo "0000:00:02.0" > /sys/bus/pci/drivers/pci-stub/bind</code></li>
<li><code># xm pci-list-assignable-devices</code>
<code>0000:00:02.0</code>
<code>0000:00:1d.0</code></li>
<li><code># echo "8086 1e20" > /sys/bus/pci/drivers/pci-stub/new_id</code></li>
<li><code># echo "0000:00:1b.0" > /sys/bus/pci/devices/0000\:00\:1b.0/driver/unbind</code></li>
<li><code># echo "0000:00:1b.0" > /sys/bus/pci/drivers/pci-stub/bind</code></li>
<li><code># xm pci-list-assignable-devices</code>
<code>0000:00:02.0</code>
<code>0000:00:1b.0</code>
<code>0000:00:1d.0</code></li>
</ol>
<br />
Do note that the devices won't be available in the dom0, that's why typical VGA Passthrough setups involve 2 or more graphics cards forwarding the more powerful to the domU alongside an USB controller and audio (I'll cover Secondary Display Adapter PCI passthrough in a future post). In this case only the CPU's integrated GPU is present so as soon has <span style="font-family: "Courier New",Courier,monospace;">00:02.0 VGA compatible controller</span> is hidden for the dom0 it can't be used by it and thus the only way to be access is via another computer using SSH for example.<br />
<br />
Update the domU's configuration file with the devices that are to be used and start the Windows 8 domU by issuing <span style="font-family: "Courier New",Courier,monospace;">xm create win8-x64.cfg</span>.<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
.indent1 { padding-left: 1em; }
.indent2 { padding-left: 2em; }
.indent3 { padding-left: 3em; }
.indent4 { padding-left: 4em; }
.indent5 { padding-left: 5em; }
.indent6 { padding-left: 6em; }
</style>
<br />
<ol class="code">
<li><code># vim /etc/xen/win8-x64.cfg</code>
<code>kernel = 'hvmloader'</code>
<code>builder = 'hvm'</code>
<code>vcpus = '4'</code>
<code>memory = '4096'</code>
<code>disk = [</code>
<code>'file:/srv/xen/domains/win8-x64.img,hda,w',</code>
<code>#'file:/srv/xen/images/Windows8-ReleasePreview-32bit-English.iso,hdc:cdrom,r'</code>
<code>]</code>
<code>name = 'win8-x64'</code>
<code>vif = [ ',mac=00:16:3E:51:20:4C,bridge=br0,model=e1000' ]</code>
<code>on_poweroff = 'destroy'</code>
<code>on_reboot = 'restart'</code>
<code>on_crash = 'restart'</code>
<code>boot = 'dc'</code>
<code>acpi = '1'</code>
<code>apic = '1'</code>
<code>viridian = '1'</code>
<code>xen_platform_pci='1'</code>
<code>sdl = '0'</code>
<code>vnc = '0'</code>
<code>vnclisten = '0.0.0.0'</code>
<code>vncpasswd = ''</code>
<code>stdvga = '0'</code>
<code>usb = '1'</code>
<code>usbdevice = 'tablet'</code><code></code>
<b> <code>pci = [ '00:1d.0', '00:1b.0' , '00:02.0' ]</code></b></li>
<li><code># xm create win8-x64.cfg</code></li>
</ol>
<br />
Also consider creating a script to automate loading <span style="font-family: "Courier New",Courier,monospace;">pci-stub</span> and unbinding/binding the PCI devices.<br />
<br />
<h3>
8) Install GPLPV drivers</h3>
Developed by James Harper, GPLPV drivers allow swapping the QEMU emulated devices for paravirtualized devices. With these new devices I/O speeds are improved as Windows will use the network and block backend drivers present in the dom0.<br />
<br />
Signed GPLPV drivers are available at <a href="http://wiki.univention.de/index.php?title=Installing-signed-GPLPV-drivers">http://wiki.univention.de/index.php?title=Installing-signed-GPLPV-drivers</a>. Windows 8 32-bit can be downloaded at <a href="http://apt.univention.de/download/addons/gplpv-drivers/gplpv_Vista2008x32_signed_0.11.0.356.msi">http://apt.univention.de/download/addons/gplpv-drivers/gplpv_Vista2008x32_signed_0.11.0.356.msi</a> while 64-bit drivers are available at <a href="http://apt.univention.de/download/addons/gplpv-drivers/gplpv_Vista2008x64_signed_0.11.0.356.msi">http://apt.univention.de/download/addons/gplpv-drivers/gplpv_Vista2008x64_signed_0.11.0.356.msi</a>.<br />
<platform><arch><span style="font-family: "Courier New",Courier,monospace;">Vista2008</span> in the drivers' installer filename means that it applies to the recent Windows releases (e.g. Vista/2008/7/8).</arch></platform><br />
<platform><arch></arch></platform><br />
<h3>
<platform><arch>9) Advices and impressions </arch></platform></h3>
<platform><arch>I've written some pieces of advices and impressions over using XEN over at <a href="http://opensource-impressions.blogspot.com/">opensource-impressions.blogspot.com</a> with some specific <a href="http://opensource-impressions.blogspot.com/2012/08/set.html">Intel HD4000 VGA Passthrough</a> so make sure to read them.</arch></platform><br />
<br />
<platform><arch>Wheezy's stock kernel doesn't contain <a href="http://cateee.net/lkddb/web-lkddb/XEN_ACPI_PROCESSOR.html"><span style="font-family: "Courier New",Courier,monospace;">xen-acpi-processor</span></a> as it was introduced during Linux kernel 3.4.x as such power management is lacking. In this scenario, consider compiling the kernel or in alternative installing Debian Experimental's kernel. The latter option implies editing <a href="http://manpages.debian.net/cgi-bin/man.cgi?query=sources.list&apropos=0&sektion=0&manpath=Debian+6.0+squeeze&format=html&locale=en"><span style="font-family: "Courier New",Courier,monospace;">/etc/apt/sources.list</span></a> to cover the experimental branch and instructing <a href="http://manpages.debian.net/cgi-bin/man.cgi?query=apt-get&apropos=0&sektion=0&manpath=Debian+6.0+squeeze&format=html&locale=en"><span style="font-family: "Courier New",Courier,monospace;">apt-get</span></a> to install the kernel package from the experimental distribution.</arch></platform><br />
<br />
<platform><arch>Xen is at version 4.1.3 in Debian Wheezy's repository however the recent 4.2.0 release is already available in the experimental branch. And with the 4.2.0 comes <span style="font-family: "Courier New",Courier,monospace;">xl</span>, the new toolstack set to replace <span style="font-family: "Courier New",Courier,monospace;">xm</span>.</arch></platform><br />
<br />
<platform><arch>In the coming weeks I'll update this HowTo with the required steps to combine Debian Experimental Xen and Linux kernel packages with the testing distribution.</arch></platform><br />
<br />
<platform><arch><b><i>Update 05/07/2013:</i></b> </arch></platform><br />
<platform><arch><i>I've moved on from HD4000 VGA passthrough and am currently using PCI passthrough on 2 AMD cards (HD7850 and HD5450) with much success. The HD5450 is assigned to a Fedora 19 domU while the HD7850 is assigned to a Windows 8 domU (Catalyst drivers aren't installed) for my gaming fix. </i></arch></platform><br />
<platform><arch><i>Stability of the setup: rock solid. dom0 is typically online for 1 to 2 months without rebooting, the Fedora 19 is hardly rebooted or shutdown while the Windows 8 domU is shutdown at night. Aside from these domU another Windows 8 domU is allways on.</i></arch></platform>tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com40tag:blogger.com,1999:blog-5845321515990016322.post-77625079444128335962012-08-16T21:47:00.000+01:002012-08-16T21:51:53.242+01:00Tip: Assign Xen dom0 memory on Debian WheezyThough Xen can manage memory with the ballon driver it is considered <a href="http://wiki.xen.org/wiki/XenBestPractices#Why_should_I_dedicate_fixed_amount_of_memory_for_Xen_dom0.3F">good practice</a> to limit/restrict the amount of memory assigned to dom0. Doing so will <a href="http://blog.xen.org/index.php/2012/04/30/do%EF%BB%BFm0-memory-where-it-has-not-gone/">stop the Linux kernel from wasting memory</a>.<br />
<br />
To do so you'll need to pass the appropriate boot parameter for both the Xen hypervisor and Linux.<br />
<br />
As an example, let's assume you want to assign 2GB to your dom0 here's how:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code>$ su</code></li>
<li><code># echo 'GRUB_CMDLINE_XEN="dom0_mem=2G,max:2G"' >> /etc/default/grub</code></li>
<li><code># update-grub2</code></li>
</ol>
<br />
The above steps were executed on Debian Wheezy running Xen 4.1.3 but should translate as well to any other distribution running Xen 4.1.2 or latter and GRUB2. Users of GRUB will need to edit grub.conf and pass down the boot parameters in an analogous manner.tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com0tag:blogger.com,1999:blog-5845321515990016322.post-51670817879762535172012-07-17T21:28:00.000+01:002012-07-17T21:28:08.574+01:00Tip: Fixing "gnome-screenshot" (No such file or directory) on CentOS 6.3While pressing <span style="font-family: "Courier New",Courier,monospace;">Prnt Scrn</span> to take a window screenshot I got awarded with "cool" Metacity message window stating the following:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>There was an error running gnome-screenshot:</code><code>Failed to execute child process "gnome-screenshot" (No such file or directory)</code></li>
</ol>
<br />
I'm running a fresh CentOS 6.3 system installed using the x86_64 Live CD which shortly after installing it noticed that it didn't came with <span style="font-family: "Courier New",Courier,monospace;">Disk Usage Analyzer</span>. Putting the error message and the missing application points the problem to the package that provides both <span style="font-family: "Courier New",Courier,monospace;">gnome-utils</span>.<br />
<br />
To fix the problem and also install the other missing applications:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>$ su</code></li>
<li><code># yum install gnome-utils -y</code></li>
</ol>
<br />
And that's it!tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com22tag:blogger.com,1999:blog-5845321515990016322.post-45459297062770971962012-07-17T18:31:00.000+01:002012-07-17T18:31:06.324+01:00Tip: Blacklisting kernel modules on CentOS 6.3While trying the <span style="font-family: "Courier New",Courier,monospace;">kernel-ml</span> from the <a href="http://www.google.pt/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CFAQFjAA&url=http%3A%2F%2Felrepo.org%2F&ei=RosFUKSzKsSzrAeYso2hBg&usg=AFQjCNGDUuWYCn0p0cSgdo_vsZLR7jtl2Q">ELRepo</a> repository I noticed that it ships with the <span style="font-family: "Courier New",Courier,monospace;">pcspkr.ko</span> kernel module which is in my opinion pretty annoying. <br />
<br />
To unload a kernel module, for instances <span style="font-family: "Courier New",Courier,monospace;">pcspkr.ko</span>, simply issue the <span style="font-family: "Courier New",Courier,monospace;">rmmod</span> command with the kernel module as argument. However this will only take place for the current session, the next time you reboot the machine hte kernel module will load. To prevent this we need to blacklist it by adding it to <code style="font-family: "Courier New",Courier,monospace;">/etc/modprobe.d/blacklist.conf<span style="font-family: inherit;">.</span></code><br />
<br />
Putting everything together:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>$ su</code></li>
<li><code># rmmod -v pcspkr</code></li>
<li><code># echo "blacklist pcspkr" >> /etc/modprobe.d/blacklist.conf</code></li>
</ol>
<br />
On step 1 we've changed to superuser, on step 2 the kernel module (<span style="font-family: "Courier New",Courier,monospace;">pcspkr</span> was selected as an example) was removed from the current session and on step 3 we've prevented it from loading at boot.<br />
<br />
As a side note, to list the currently loaded kernel modules run <span style="font-family: "Courier New",Courier,monospace;">lsmod</span>.tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com0tag:blogger.com,1999:blog-5845321515990016322.post-22469271674432354822012-07-15T22:55:00.000+01:002012-08-23T12:47:22.262+01:00Tip: Remove xen-runtime from kernel-xen repositoryLately I've been messing with Xen.<br />
<br />
In the process of using the <a href="http://www.crc.id.au/repo">kernel-xen</a> repository I came across the following situation while attempting to uninstall <span style="font-family: "Courier New",Courier,monospace;">xen-runtime</span>:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code># yum remove xen-runtime<br />
Loaded plugins: fastestmirror, refresh-packagekit, security<br />
Setting up Remove Process<br />
<br />
Resolving Dependencies<br />
<br />
--> Running transaction check<br />
---> Package xen-runtime.x86_64 0:4.1.2-8.el6 will be erased<br />
--> Finished Dependency Resolution<br />
Dependencies Resolved<br />
==================================================================<br />
Package Arch Version Repository Size<br />
================================================================== Removing:<br />
xen-runtime x86_64 4.1.2-8.el6 @kernel-xen 8.0 M
<br />
<br />
Transaction Summary<br />
==================================================================<br />
Remove 1 Package(s)<br />
<br />
Installed size: 8.0 M<br />
Is this ok [y/N]: y<br />
Downloading Packages:<br />
Running rpm_check_debug<br />
Running Transaction Test<br />
Transaction Test Succeeded<br />
Running Transaction<br />
Error in PREUN scriptlet in rpm package xen-runtime<br />
xen-runtime-4.1.2-8.el6.x86_64 was supposed to be removed but is not!<br />
Verifying : xen-runtime-4.1.2-8.el6.x86_64 1/1<br />
<br />
Failed:<br />
xen-runtime.x86_64 0:4.1.2-8.el6 <br />
</code><code>Complete!</code></li>
<code></code>
<li><code># rpm -e xen-runtime<br />
/var/tmp/rpm-tmp.LcPd6z: line 5: /bin/systemctl: No such file or directory</code><code>error: %preun(xen-runtime-4.1.2-8.el6.x86_64) scriptlet failed, exit status 127</code></li>
</ol>
<br />
To remove the little bastard the <span style="font-family: "Courier New",Courier,monospace;">--nopreun</span> needs to be passed down to <span style="font-family: "Courier New",Courier,monospace;">rpm -e</span>. By doing so the execution of the <span style="font-family: "Courier New",Courier,monospace;">%preun</span> scriptlet is turned off thus allowing <span style="font-family: "Courier New",Courier,monospace;">rpm </span>to uninstall the offending package, like so:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code># rpm -e --nopreun xen-runtime</code></li>
</ol>
<br />
Done!<br />
<br />
Now I can go back to messing with Xen ;)tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com0tag:blogger.com,1999:blog-5845321515990016322.post-54754355162774708582012-07-14T22:56:00.000+01:002012-07-14T22:56:13.849+01:00HowTo: Install Adobe Flash Player using Repoforge on CentOS 6.3To install Adobe Flash Player on RHEL or CentOS 6.3 using the Repoforge repository, you'll need to change
to root, import repository's GPG key, install the repository file and install the Adobe Flash Player package.<br />
<br />
If you're running a 32 bits system:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>$ su</code></li>
<li><code># rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt</code></li>
<li><code># rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm</code></li>
<li><code># yum install flash-plugin</code></li>
</ol>
<br />
On the other hand, if you have a 64 bits install issue the following commands:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>$ su</code></li>
<li><code># rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt</code></li>
<li><code># rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm</code></li>
<li><code># yum install flash-plugin</code></li>
</ol>
<br />
Launch Mozilla Firefox and in the address bar enter <span style="font-family: 'Courier New',Courier,monospace;">about:plugins</span>. An Shockwave Flash entry should be available.<br />
<br />
If you point to <b><i>System -> Preferences</i></b> you'll notice that a new entry named <i><b>Adobe Flash Player</b></i> is now available. <br />
<br />
You can test if the plugin is working by visiting <a href="http://www.adobe.com/software/flash/about">http://www.adobe.com/software/flash/about</a> or by firing up a random Youtube clip.<br />
<br />
If you'd prefer to using Adobe's own YUM repository follow the steps described in <a href="http://linux-bsd-sharing.blogspot.pt/2012/05/howto-install-adobe-flash-player-on.html">http://linux-bsd-sharing.blogspot.pt/2012/05/howto-install-adobe-flash-player-on.html</a> and <a href="http://linux-bsd-sharing.blogspot.pt/2012/04/howto-install-adobe-flash-player-on.html">http://linux-bsd-sharing.blogspot.pt/2012/04/howto-install-adobe-flash-player-on.html</a> for 64 and 32 bit systems, respectively. <br />tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com3tag:blogger.com,1999:blog-5845321515990016322.post-67625173540949006072012-07-09T22:54:00.000+01:002012-07-14T22:36:39.511+01:00HowTo: Enable Wake-on-LAN on CentOS / SL 6.3Wake-on-LAN also know as WOL is the ability to switch on a computer that
is connected to a network (local or not) by means of a special network
message called a magic packet. This magic packet contains the MAC
address of the destination computer. If the destination computer has a
network interface card that support WOL then the system wakes up.<br />
<br />
In this post I'll describe how to setup a CentOS destination computer so that it can be turned on from another computer. This procedure is also applicable to RHEL and its clones such as Scientific Linux and Oracle Unbreakable Linux.<br />
<br />
For sake of simplicity I've broken down the procedure into a few steps:<br />
1) Enable WOL in BIOS<br />
2) Collect network interface information<br />
3) Enable WOL for the next shutdown<br />
4) Make WOL always enabled<br />
5) Wake up the computer from local network<br />
6) Wake up the computer from internet<br />
7) Troubleshooting<br />
<br />
<h3>
1) Enable WOL in BIOS</h3>
These days pretty much all integrated or otherwise NICs support
Wake-on-LAN, however more often than not you'll need to enable it in the
BIOS. There are literally hundreds of BIOS around but look for the
typical options: <i>"Enable Wake-on-LAN"</i>, <i>"Enable Wake on PCI"</i> and <i>"Enable Power of PCIE Devices"</i>.<br />
<br />
<h3>
2) Collect network interface information</h3>
Start by checking if the destination computer network card support Wake-on-LAN with <span style="font-family: "Courier New",Courier,monospace;">ethtool</span>:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>$ ifconfig<br />eth0 Link encap:Ethernet HWaddr 00:11:AA:22:BB:22 <br /> inet addr:192.168.1.5 Bcast:192.168.1.255 Mask:255.255.255.0<br /> inet6 addr: fc70::151:8daa:fbab:f14a/64 Scope:Link<br /> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br /> RX packets:563668 errors:0 dropped:0 overruns:0 frame:0<br /> TX packets:317604 errors:0 dropped:0 overruns:0 carrier:0<br /> collisions:0 txqueuelen:1000 <br /> RX bytes:813741621 (776.0 MiB) TX bytes:68592900 (65.4 MiB)<br /> Interrupt:22 Base address:0xa000 <br /><br />lo Link encap:Local Loopback <br /> inet addr:127.0.0.1 Mask:255.0.0.0<br /> inet6 addr: ::1/128 Scope:Host<br /> UP LOOPBACK RUNNING MTU:16436 Metric:1<br /> RX packets:8 errors:0 dropped:0 overruns:0 frame:0<br /> TX packets:8 errors:0 dropped:0 overruns:0 carrier:0<br /> collisions:0 txqueuelen:0 <br /> RX bytes:480 (480.0 b) TX bytes:480 (480.0 b)</code></li>
<code></code>
<li><code>
$ su </code></li>
<code></code>
<li><code>
# ethtool eth0<br />
Settings for eth0:<br />
Supported ports: [ MII ]<br />
Supported link modes: 10baseT/Half 10baseT/Full <br />
100baseT/Half 100baseT/Full <br />
Supports auto-negotiation: Yes<br />
Advertised link modes: 10baseT/Half 10baseT/Full <br />
100baseT/Half 100baseT/Full <br />
Advertised pause frame use: No<br />
Advertised auto-negotiation: Yes<br />
Speed: 100Mb/s<br />
Duplex: Full<br />
Port: MII<br />
PHYAD: 1<br />
Transceiver: external<br />
Auto-negotiation: on<br />
<b> Supports Wake-on: g</b><br />
<b> Wake-on: d</b><br />
Link detected: yes </code><code></code></li>
</ol>
<br />
The "<span style="font-family: "Courier New",Courier,monospace;">Supports Wake-on: g</span>" string means that the NIC does in fact support Wake-on-LAN while "<span style="font-family: "Courier New",Courier,monospace;">Wake-on: d</span>" is a sign that the feature is not turned activated in the operating system.<br />
<br />
Do notice that the target of <span style="font-family: "Courier New",Courier,monospace;">ethtool</span> was <span style="font-family: "Courier New",Courier,monospace;">eth0</span> which is my destination computer's network interface name.<br />
<br />
To use Wake-on-LAN we need to identify the NIC MAC address to which end <span style="font-family: "Courier New",Courier,monospace;">ifconfig</span> can be used:<br />
<ol class="code">
<li><code># ifconfig | grep HWaddr</code><code><b>eth0</b> Link encap:Ethernet HWaddr 00:11:AA:22:BB:22</code></li>
</ol>
<br />
<h3>
3) Enable WOL for the next shutdown</h3>
To command the operating system to enable WOL for the <span style="font-family: "Courier New",Courier,monospace;">eth0</span> network interface run:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># ethtool -s eth0 wol g</code></li>
</ol>
<br />
Issuing <span style="font-family: "Courier New",Courier,monospace;">ethtool</span> again now returns "<span style="font-family: "Courier New",Courier,monospace;">Wake-on: g</span>" so now we have WOL enabled:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># ethtool eth0<br />
Settings for eth0:<br />
Supported ports: [ MII ]<br />
Supported link modes: 10baseT/Half 10baseT/Full <br />
100baseT/Half 100baseT/Full <br />
Supports auto-negotiation: Yes<br />
Advertised link modes: 10baseT/Half 10baseT/Full <br />
100baseT/Half 100baseT/Full <br />
Advertised pause frame use: No<br />
Advertised auto-negotiation: Yes<br />
Speed: 100Mb/s<br />
Duplex: Full<br />
Port: MII<br />
PHYAD: 1<br />
Transceiver: external<br />
Auto-negotiation: on<br />
<b> Supports Wake-on: g</b><br />
<b> Wake-on: g</b><br />
Link detected: yes</code><code></code></li>
</ol>
<br />
<h3>
4) Make WOL always enabled</h3>
To have WOL always enabled the operating system needs to be told that <span style="font-family: "Courier New",Courier,monospace;">eth0</span> (this is my NIC's interface name, don't forget to change according to your own system) WOL is supposed to be active.<br />
<br />
There are 2 methods to achieve this, one employs adding <span style="font-family: "Courier New",Courier,monospace;">ethtool -s eth0 wol g</span> command to <span style="font-family: "Courier New",Courier,monospace;">/etc/rc.d/rc.local</span> while the other consists in creating a network script and enabling the network service.<br />
<br />
Choose one of the methods, personally I'd go for the <span style="font-family: "Courier New",Courier,monospace;">/etc/rc.d/rc.local</span> method as it requires less typing ;)<br />
<br />
<b>Method A</b><br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>#echo '/usr/sbin/ethtool -s eth0 wol g' >> /etc/rc.d/rc.local</code></li>
</ol>
<br />
<b>Method B</b><style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># vim /etc/sysconfig/network-scripts/ifcfg-eth0<br />
DEVICE=eth0<br />
TYPE=EThernet </code><code>ONBOOT=yes</code><code>ETHTOOL_OPTS="wol g"</code></li>
<li><code># chkconfig network on</code></li>
</ol>
<br />
<h3>
5) Wake up the computer from local network</h3>
From the computer that will be used to send the magic WOL packet, install and run <span style="font-family: "Courier New",Courier,monospace;">wakelan</span>:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># yum install wakelan</code></li>
<li><code># rehash</code></li>
<li><code># wakelan 00:11:AA:22:BB:22</code></li>
</ol>
<br />
<h3>
6) Wake up the computer from internet</h3>
This involves enabling port forwarding of UDP port 9 to the destination
computer in the router's administration webpage. To fully benefit from
WOL you should configure a dynamic DNS service.<br />
<br />
Afterwards to issue the wake up command you can use websites such as <a href="http://wakeonlan.me/">http://wakeonlan.me</a>, Android applications (<a href="http://android.mafro.net/">Wake on Lan</a>)
or any other Wake-on-LAN application (every Unix-like system as an
alternative available). Just make sure to use your dynamic DNS provided
address and the destination computer's MAC.<br />
<br />
<h3>
</h3>
<h3>
7) Troubleshooting</h3>
While troubleshooting Wake-on-LAN I've noticed that if you use GRUB
without <span style="font-family: "Courier New",Courier,monospace;">timeout</span> set and <span style="font-family: "Courier New",Courier,monospace;">poweroff</span> the computer while on the operating
system selection menu, the next time you try to use Wake-on-LAN it won't
work. So make sure you have GRUB with a <span style="font-family: "Courier New",Courier,monospace;">timeout</span> set (which is the case
will all default installation of GRUB).<br />
<br />
If the computer is disconnected from the power supply you'll need to
boot the computer and turn off again so that the NIC assumes the WOL
definitions.tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com3tag:blogger.com,1999:blog-5845321515990016322.post-30130563591714694472012-06-20T23:28:00.002+01:002012-06-22T23:31:44.593+01:00HowTo: Enable Wake-on-LAN on GentooWake-on-LAN also know as WOL is the ability to switch on a computer that is connected to a network (local or not) by means of a special network message called a magic packet. This magic packet contains the MAC address of the destination computer. If the destination computer has a network interface card that support WOL then the system wakes up.<br />
<br />
In this post I'll describe how to setup a Gentoo destination computer so that it can be turned on from another computer.<br />
<br />
For sake of simplicity I've broken down the procedure into a few steps:<br />
1) Enable WOL in BIOS<br />
2) Install ethtool<br />
3) Collect network interface information<br />
4) Enable WOL for the next shutdown<br />
5) Make WOL always enabled<br />
6) Wake up the computer from local network<br />
7) Wake up the computer from internet<br />
8) Troubleshooting<br />
<br />
<h3>
1) Enable WOL in BIOS</h3>
These days pretty much all integrated or otherwise NICs support Wake-on-LAN, however more often than not you'll need to enable it in the BIOS. There are literally hundreds of BIOS around but look for the typical options: <i>"Enable Wake-on-LAN"</i>, <i>"Enable Wake on PCI"</i> and <i>"Enable Power of PCIE Devices"</i>.<br />
<br />
<h3>
2) Install ethtool</h3>
Take <span style="font-family: "Courier New",Courier,monospace;">emerge</span> for a spin and install <a href="http://gentoo-portage.com/sys-apps/ethtool">sys-apps/ethtool</a>. <span style="font-family: "Courier New",Courier,monospace;">ethtool</span> is an utility for examining and tuning ethernet-based network interfaces.<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># emerge ethtool</code></li>
<li><code># rehash</code></li>
</ol>
<br />
<h3>
3) Collect network interface information</h3>
To use Wake-on-LAN we need to identify the NIC MAC address. For example, in my computer the MAC address is <span style="font-family: "Courier New",Courier,monospace;">00:aa:11:bb:22:cc</span>.<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># ifconfig</code><code><span style="font-size: x-small;">eth0 Link encap:Ethernet <span style="font-size: small;"><b>HWaddr 00:aa:11:bb:22:cc</b></span> <br /> inet addr:192.168.1.3 Bcast:192.168.1.255 Mask:255.255.255.0<br /> inet6 addr: fa10::120:1aef:ffeb:b78a/64 Scope:Link<br /> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br /> RX packets:129199 errors:0 dropped:0 overruns:0 frame:0<br /> TX packets:165680 errors:0 dropped:0 overruns:0 carrier:0<br /> collisions:0 txqueuelen:1000 <br /> RX bytes:58680158 (55.9 MiB) TX bytes:26252276 (25.0 MiB)<br /> Interrupt:10 Base address:0xa000 <br /><br />lo Link encap:Local Loopback <br /> inet addr:127.0.0.1 Mask:255.0.0.0<br /> inet6 addr: ::1/128 Scope:Host<br /> UP LOOPBACK RUNNING MTU:16436 Metric:1<br /> RX packets:0 errors:0 dropped:0 overruns:0 frame:0<br /> TX packets:0 errors:0 dropped:0 overruns:0 carrier:0<br /> collisions:0 txqueuelen:0 <br /> RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)</span></code></li>
</ol>
<br />
Check if the NIC does support the Wake-on-LAN feature:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># ethtool eth0</code><code><span style="font-size: x-small;">Settings for eth0:<br /> Supported ports: [ MII ]<br /> Supported link modes: 10baseT/Half 10baseT/Full <br /> 100baseT/Half 100baseT/Full <br /> Supported pause frame use: No<br /> Supports auto-negotiation: Yes<br /> Advertised link modes: 10baseT/Half 10baseT/Full <br /> 100baseT/Half 100baseT/Full <br /> Advertised pause frame use: No<br /> Advertised auto-negotiation: Yes<br /> Speed: 100Mb/s<br /> Duplex: Full<br /> Port: MII<br /> PHYAD: 1<br /> Transceiver: external<br /> Auto-negotiation: on<br /> <span style="font-size: small;"><b>Supports Wake-on: g<br /> Wake-on: d</b></span><br /> Link detected: yes</span></code></li>
</ol>
<br />
The "<span style="font-family: "Courier New",Courier,monospace;">Supports Wake-on: g</span>" string means that the NIC does in fact support Wake-on-LAN while "<span style="font-family: "Courier New",Courier,monospace;">Wake-on: d</span>" is a sign that the feature isn't active.<br />
<br />
<h3>
4) Enable WOL for the next shutdown</h3>
To command the operating system to enable WOL for the <span style="font-family: "Courier New",Courier,monospace;">eth0</span> network interface run:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># ethtool -s eth0 wol g</code></li>
</ol>
<br />
Issuing <span style="font-family: "Courier New",Courier,monospace;">ethtool</span> again now returns "<span style="font-family: "Courier New",Courier,monospace;">Wake-on: g</span>" so now we have WOL enabled:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># ethtool eth0<br /><span style="font-size: x-small;">Settings for eth0:<br /> Supported ports: [ MII ]<br /> Supported link modes: 10baseT/Half 10baseT/Full<br /> 100baseT/Half 100baseT/Full<br /> Supported pause frame use: No<br /> Supports auto-negotiation: Yes<br /> Advertised link modes: 10baseT/Half 10baseT/Full<br /> 100baseT/Half 100baseT/Full<br /> Advertised pause frame use: No<br /> Advertised auto-negotiation: Yes<br /> Speed: 100Mb/s<br /> Duplex: Full<br /> Port: MII<br /> PHYAD: 1<br /> Transceiver: external<br /> Auto-negotiation: on<br /> <span style="font-size: small;"><b>Supports Wake-on: g<br /> Wake-on: g</b></span><br /> Link detected: yes</span></code></li>
</ol>
<br />
<h3>
5) Make WOL always enabled</h3>
To have WOL always enabled Gentoo needs to be told that <span style="font-family: "Courier New",Courier,monospace;">eth0</span> WOL is supposed to be active.<br />
<br />
Assuming your're using OpenRC (which you should) add <span style="font-family: "Courier New",Courier,monospace;">ethtool -s eth0 wol g</span> to <span style="font-family: "Courier New",Courier,monospace;">/etc/local.d/wol.start</span>:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># echo "ethtool -s eth0 wol g" > /etc/local.d/wol.start</code></li>
<li><code># chmod +x /etc/local.d/wol.start</code></li>
</ol>
<br />
The <span style="font-family: "Courier New",Courier,monospace;">/etc/local.d/</span>
directory contains scripts which are to be run when local service is
started or stopped, so by adding a script with an executable script with
a <span style="font-family: "Courier New",Courier,monospace;">.start</span> extension, it will be run when the local service is started at boot.<br />
<br />
<h3>
6) Wake up the computer from local network</h3>
From the computer that will be used to send the magic WOL packet, install and run <a href="http://gentoo-portage.com/net-misc/wakeonlan">net-misc/wakeonlan</a>:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># emerge wakeonlan</code></li>
<li><code># rehash</code></li>
<li><code># wakeonlan -i 192.168.1.255 00:50:8d:eb:a7:8a</code></li>
</ol>
<br />
Replace <span style="font-family: "Courier New",Courier,monospace;">192.168.1.255</span> with the broadcast from your network. <span style="font-family: "Courier New",Courier,monospace;">192.168.1.255</span> is the broadcast address for a <span style="font-family: "Courier New",Courier,monospace;">192.168.1.x</span> subnet which is the case of my local network.<br />
<br />
<h3>
7) Wake up the computer from internet</h3>
This involves enabling port forwarding of UDP port 9 to the destination
computer in the router's administration webpage. To fully benefit from
WOL you should configure a dynamic DNS service.<br />
<br />
Afterwards to issue the wake up command you can use websites such as <a href="http://wakeonlan.me/">http://wakeonlan.me</a>, Android applications (<a href="http://android.mafro.net/">Wake on Lan</a>)
or any other Wake-on-LAN application (every Unix-like system as an
alternative available). Just make sure to use your dynamic DNS provided
address and the destination computer's MAC.<br />
<br />
<h3>
8) Troubleshooting</h3>
While troubleshooting Wake-on-LAN I've noticed that if you use GRUB without timeout set and poweroff the computer while on the operating system selection menu, the next time you try to use Wake-on-LAN it won't work. So make sure you have GRUB with a timeout set (which is the case will all default installation of GRUB).<br />
<br />
If the computer is disconnected from the power supply you'll need to boot the computer and turn off again so that the NIC assumes the WOL definitions.tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com3tag:blogger.com,1999:blog-5845321515990016322.post-86163078283315896732012-06-20T22:31:00.002+01:002012-06-20T22:43:41.414+01:00HowTo: Enable Wake-on-LAN on FreeBSDWake-on-LAN also know as WOL is the ability to switch on a computer that is connected to a network (local or otherwise) by means of a special network message called a magic packet. This magic packet contains the MAC address of the destination computer. If the destination computer has a network interface card that supports WOL then the system wakes up.<br />
<br />
In this post I'll describe how to Wake-on-LAN a FreeBSD destination computer so that it can be turned on from another computer.<br />
<br />
For sake of simplicity I've broken down the procedure into a few steps:<br />
1) Enable WOL in BIOS<br />
2) Check for driver WOL support<br />
3) Collect network interface information<br />
4) Wake up computer from local network<br />
5) Wake up computer from internet<br />
<br />
<h3>
1) Enable WOL in BIOS</h3>
These days pretty much all integrated or otherwise NICs support Wake-on-LAN, however more often than not you'll need to enable it in the BIOS. There are literally hundreds of BIOS around but look for the typical options: <i>"Enable Wake-on-LAN"</i>, <i>"Enable Wake on PCI"</i> and <i>"Enable Power of PCIE Devices"</i>.<br />
<br />
<h3>
2) Check for driver WOL support</h3>
With each FreeBSD release more and more ethernet drivers get support for Wake-on-LAN. To check the list of drivers with WOL support in your FreeBSD release (in my case 7.4-RELEASE) run:<br />
<ol class="code">
<li><code>$ grep -l IFCAP_WOL /usr/src/sys/dev/*/*.c<br />/usr/src/sys/dev/ae/if_ae.c<br />/usr/src/sys/dev/age/if_age.c<br />/usr/src/sys/dev/alc/if_alc.c<br />/usr/src/sys/dev/ale/if_ale.c<br />/usr/src/sys/dev/e1000/if_em.c<br />/usr/src/sys/dev/e1000/if_lem.c<br />/usr/src/sys/dev/fxp/if_fxp.c<br />/usr/src/sys/dev/jme/if_jme.c<br />/usr/src/sys/dev/nfe/if_nfe.c<br />/usr/src/sys/dev/nge/if_nge.c<br /><b>/usr/src/sys/dev/re/if_re.c</b><br />/usr/src/sys/dev/sis/if_sis.c<br />/usr/src/sys/dev/ste/if_ste.c<br />/usr/src/sys/dev/stge/if_stge.c<br />/usr/src/sys/dev/txp/if_txp.c<br />/usr/src/sys/dev/vge/if_vge.c<br />/usr/src/sys/dev/vr/if_vr.c</code></li>
</ol>
<br />
Now compare the list of WOL supported drivers with the driver attached to your network interface:<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> $ ifconfig -m
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,<b>WOL_UCAST,WOL_MCAST,WOL_MAGIC</b>>
capabilities=4399b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,<b>WOL_UCAST,WOL_MCAST,WOL_MAGIC</b>,VLAN_HWTSO>
ether 00:aa:11:bb:22:cc
inet 192.168.1.3 netmask 0xffffff00 broadcast 192.168.1.255
media: Ethernet autoselect (100baseTX <full-duplex>)
<b>status: active </b>
supported media:
media autoselect mediaopt flowcontrol
media autoselect
media 1000baseTX mediaopt full-duplex,flowcontrol,master
media 1000baseTX mediaopt full-duplex,flowcontrol
media 1000baseTX mediaopt full-duplex,master
media 1000baseTX mediaopt full-duplex
media 1000baseTX mediaopt master
media 1000baseTX
media 100baseTX mediaopt full-duplex,flowcontrol
media 100baseTX mediaopt full-duplex
media 100baseTX
media 10baseT/UTP mediaopt full-duplex,flowcontrol
media 10baseT/UTP mediaopt full-duplex
media 10baseT/UTP
media none
plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> metric 0 mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
inet6 fe80::1 prefixlen 64 scopeid 0x4
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000 </code></pre>
By analysing the output of <span style="font-family: "Courier New",Courier,monospace;">ifconfig</span> one can notice that I have <span style="font-family: "Courier New",Courier,monospace;">re</span> driver attached to network card. Also the <span style="font-family: "Courier New",Courier,monospace;">re0</span> card not only is capable of WOL but also it is already setup to use it.<br />
<br />
FreeBSD is extremely well documented and as such WOL support can be confirmed in <a href="http://www.freebsd.org/cgi/man.cgi?query=re&sektion=4&manpath=FreeBSD+9.0-RELEASE">re(4)</a> man page.<br />
<br />
<h3>
3) Collect network interface information</h3>
From the output of <span style="font-family: "Courier New",Courier,monospace;">ifconfig -m</span> I can write down the MAC address for <span style="font-family: "Courier New",Courier,monospace;">re0</span>, <span style="font-family: "Courier New",Courier,monospace;">00:aa:11:bb:22:cc</span>.<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>$ ifconfig -m | grep ether</code><code> <b>ether</b> 00:aa:11:bb:22:cc </code></li>
</ol>
<br />
<h3>
4) Wake up computer from local network</h3>
With the destination computer turned off, from the computer that will be used to send the magic WOL packet, install the <a href="http://www.freshports.org/net/wakeonlan">net/wakeonlan</a> port and run it:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; } .code code { display: block; padding: 3px; margin-bottom: 0; } .code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style> <br />
<ol class="code">
<li><code># cd /usr/ports/net/wakeonlan</code></li>
<li><code># make install clean</code></li>
<li><code># rehash</code></li>
<li><code># wakeonlan -i 192.168.1.255 00:aa:11:bb:22:cc</code></li>
</ol>
<br />
Replace <span style="font-family: "Courier New",Courier,monospace;">192.168.1.255</span> with the broadcast from your network. <span style="font-family: "Courier New",Courier,monospace;">192.168.1.255</span> is the broadcast address for a <span style="font-family: "Courier New",Courier,monospace;">192.168.1.x</span> subnet which is the case of my local network and <span style="font-family: "Courier New",Courier,monospace;">00:aa:11:bb:22:cc</span> is MAC address of the destination computer.<br />
<br />
It should be noted that <a href="http://www.freshports.org/net/wakeonlan">net/wakeonlan</a> and similar applications are available in all Unix-like operating systems.<br />
<br />
<h3>
5) Wake up computer from internet</h3>
This involves enabling port forwarding of UDP port 9 to the destination computer in the router's administration webpage. To fully benefit from WOL you should configure a dynamic DNS service.<br />
<br />
Afterwards to issue the wake up command you can use websites such as <a href="http://wakeonlan.me/">http://wakeonlan.me</a>, Android applications (<a href="http://android.mafro.net/">Wake on Lan</a>) or any other Wake-on-LAN application (every Unix-like system as an alternative available). Just make sure to use your dynamic DNS provided address and the destination computer's MAC.tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com1tag:blogger.com,1999:blog-5845321515990016322.post-39360462449246927082012-06-07T20:58:00.002+01:002012-06-07T21:05:24.191+01:00HowTo: Install and setup MiniDLNA on FreeBSDMiniDLNA is a server software with the aim of being fully compliant with DLNA/UPnP-AV clients. MiniDLNA is used to serve multimedia files such as music, videos and picture to clients on a given network.<br />
<br />
MiniDLNA employs Universal Plug and Play (UPnP) thus you can have clients such as TVs, consoles and smartphones.<br />
<br />
In this post I'll describe the steps needed to install and configure it to run on FreeBSD, though the steps were performed on 7.4-RELEASE they'll work on more recent FreeBSD branches such as 8.x and 9.x.<br />
<br />
Let's start by installing the <a href="http://www.freshports.org/net/minidlna/">net/minidlna</a> port:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># cd /usr/ports/net/minidlna</code></li>
<li><code># make config-recursive</code></li>
<li><code># make install clean</code></li>
</ol>
<br />
Having installed the port, it's time to edit the configuration file. <u>As an example</u>, I'll leave my own as reference. Make sure that you edit <span style="font-family: "Courier New",Courier,monospace;">network_interface</span>, <span style="font-family: "Courier New",Courier,monospace;">media_dir</span> and <span style="font-family: "Courier New",Courier,monospace;">friendly_name</span>.<br />
<ol class="code">
<li><code># vim /usr/local/etc/minidlna.conf<br />
<br />
# port for HTTP (descriptions, SOAP, media transfer) traffic<br />port=8200<br /><br /># network interfaces to serve, comma delimited<br />network_interface=re0<br /><br /># set this to the directory you want scanned.<br /># * if have multiple directories, you can have multiple media_dir= lines<br /># * if you want to restrict a media_dir to a specific content type, you<br /># can prepend the type, followed by a comma, to the directory:<br /># + "A" for audio (eg. media_dir=A,/home/jmaggard/Music)<br /># + "V" for video (eg. media_dir=V,/home/jmaggard/Videos)<br /># + "P" for images (eg. media_dir=P,/home/jmaggard/Pictures)<br />media_dir=V,/home/samba/public/movies<br />media_dir=V,/mnt/1/tv<br />media_dir=V,/mnt/2/anime<br />media_dir=A,/mnt/1/music<br />media_dir=P,/mnt/1/photos<br /><br /># set this if you want to customize the name that shows up on your clients<br />friendly_name=FreeBSD DLNA Server<br /><br /># set this if you would like to specify the directory where you want MiniDLNA to store its database and album art cache<br />db_dir=/var/db/minidlna<br /><br /># set this if you would like to specify the directory where you want MiniDLNA to store its log file<br />log_dir=/var/db/minidlna<br /><br /># set this to change the verbosity of the information that is logged<br /># each section can use a different level: off, fatal, error, warn, info, or debug<br />log_level=general,artwork,database,inotify,scanner,metadata,http,ssdp,tivo=warn<br /><br /># this should be a list of file names to check for when searching for album art<br /># note: names should be delimited with a forward slash ("/")<br />album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg<br /><br /># set this to no to disable inotify monitoring to automatically discover new files<br /># note: the default is yes<br />inotify=yes<br /><br /># set this to yes to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO<br />enable_tivo=no<br />
<br />
# set this to strictly adhere to DLNA standards.<br /># * This will allow server-side downscaling of very large JPEG images,<br /># which may hurt JPEG serving performance on (at least) Sony DLNA products.<br />strict_dlna=no<br /><br /># default presentation url is http address on port 80<br />#presentation_url=http://www.mylan/index.php<br /><br /># notify interval in seconds. default is 895 seconds.<br />notify_interval=900<br /><br /># serial and model number the daemon will report to clients<br /># in its XML description<br />serial=1337<br />model_number=1<br /><br /># specify the path to the MiniSSDPd socket<br />#minissdpdsocket=/var/run/minissdpd.sock<br /><br /># use different container as root of the tree<br /># possible values:<br /># + "." - use standard container (this is the default)<br /># + "B" - "Browse Directory"<br /># + "M" - "Music"<br /># + "V" - "Video"<br /># + "P" - "Pictures"<br /># if you specify "B" and client device is audio-only then "Music/Folders" will be used as root<br />#root_container=.</code><code></code></li>
</ol>
<br />
To have MiniDLNA working properly the <span style="font-family: "Courier New",Courier,monospace;">dlna</span> user must be made owner of the <span style="font-family: "Courier New",Courier,monospace;">/var/db/minidlna</span> directory:<br />
<ol class="code">
<li><code># mkdir -p /var/db/minidlna</code></li>
<li><code># chown dlna:dlna /var/db/minidlna</code></li>
</ol>
<br />
To start using MiniDLNA immediately issue the following command:<br />
<ol class="code">
<li><code># /usr/local/etc/rc.d/minidlna onestart</code></li>
</ol>
<br />
If you want to have it start up automatically whenever FreeBSD boots, add it to <span style="font-family: "Courier New",Courier,monospace;">/etc/rc.conf</span> like so:<br />
<ol class="code">
<li><code># echo 'minidlna_enable="YES"' >> /etc/rc.conf</code></li>
</ol>
<br />
Finally MiniDLNA's log file can be monitored for errors:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># tail -f /var/db/minidlna/minidlna.log</code></li>
</ol>
<br />
MiniDLNA it's quite simple and lightweight however it is missing features that can be found in more complete UPnP servers. Those operating on old hardware might find it very useful.<br />
<br />
Be advised that if you're planning on sharing multimedia files over a local network composed mainly of desktops and laptops, NFS and Samba are more flexible filesharing alternatives. On the other hand, if you want to stream to a TV, console or smartphone then by all means go for an UPnP server like MiniDLNA or MediaTomb.<br />
<br />
If you're using an Android smartphone have a look at the MediaHouse app. From my experience it works just fine with MiniDLNA.tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com9tag:blogger.com,1999:blog-5845321515990016322.post-57779630390305539862012-06-01T09:55:00.000+01:002012-06-01T09:55:22.813+01:00HowTo: Shrink size of ext4 LVM logical volumeLVM, the Logical Volume Manager, is extremely flexible and provides numerous advantages over standard partitions. One of those advantages consists in resizing logical volumes.<br />
<br />
In this post I'll go over the required steps to reduce the size of an LVM logical volume formatted as an <span style="font-family: 'Courier New', Courier, monospace;">ext4</span> filesystem. This is achieved can be achieved in a few steps:<br />
1) Unmount the logical volume (or boot into a live CD if the logical volume contains the root filesystem)<br />
2) Check the filesystem for errors<br />
3) Shrink the filesystem to the desired size<br />
4) Reduce the size of the underlying logical volume<br />
5) Check if the resulting logical volume and filesystem are ok<br />
6) Re-mount the logical volume<br />
<br />
To illustrate the procedure assume a volume group name <span style="font-family: 'Courier New', Courier, monospace;">vg_d620</span> which contains the <span style="font-family: 'Courier New', Courier, monospace;">lv_example</span> logical group. The objective will be to shrink the <span style="font-family: 'Courier New', Courier, monospace;">lv_example</span> logical group that is formatted with <span style="font-family: 'Courier New', Courier, monospace;">ext4</span> to <span style="font-family: 'Courier New', Courier, monospace;">30G</span>.<br />
<br />
<h3>
1) Unmount the logical volume</h3>
Change to the superuser and unmount the logical volume filesystem that is to be resized:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>$ su</code></li>
<li><code># umount /dev/mapper/vg_d620-lv_example</code></li>
</ol>
<br />
<h3>
2) Check the filesystem for errors</h3>
<span style="font-family: 'Courier New', Courier, monospace;">e2fsck</span> checks a Linux ext2/ext3/ext4 filesystem for errors, in this case the <span style="font-family: 'Courier New', Courier, monospace;">-f</span> switch is used to force the check even if the filesystem appears to be clean:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># e2fsck -f /dev/mapper/vg_d620-lv_example</code></li>
<li><code>e2fsck 1.41.12 (17-May-2010)<br />
Pass 1: Checking inodes, blocks, and sizes<br />
Pass 2: Checking directory structure<br />
Pass 3: Checking directory connectivity<br />
Pass 4: Checking reference counts<br />
Pass 5: Checking group summary information</code><code>/dev/mapper/vg_d620-lv_example: 11448/3678208 files (1.5% non-contiguous), 4768046/14704640 blocks</code></li>
</ol>
<br />
<h3>
3) Shrink the filesystem to the desired size</h3>
<span style="font-family: 'Courier New', Courier, monospace;">resize2fs</span> is used to shrink our unmounted filesystem located on <span style="font-family: 'Courier New', Courier, monospace;">vol_d620-lv_example</span>. The <span style="font-family: 'Courier New', Courier, monospace;">-p</span> switch is prints out percentage completion bars for the resize operation. Here the <span style="font-family: 'Courier New', Courier, monospace;">ext4</span> filesystem is reduced to the desired filesystem final size, in this case I want it to be of <span style="font-family: 'Courier New', Courier, monospace;">30 gigabytes</span>:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># resize2fs -p /dev/mapper/vg_d620-lv_example 30G</code></li>
<li><code>resize2fs 1.41.12 (17-May-2010)<br />
Resizing the filesystem on /dev/mapper/vg_d620-lv_example to 7864320 (4k) blocks.<br />
Begin pass 2 (max = 16894)<br />
Relocating blocks XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br />
Begin pass 3 (max = 449)<br />
Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br />
Begin pass 4 (max = 1866)<br />
Updating inode references XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</code><code>The filesystem on /dev/mapper/vg_d620-lv_example is now 7864320 blocks long.</code></li>
</ol>
<br />
<h3>
4) Reduce the size of the underlying logical volume</h3>
Having shrunk the <span style="font-family: 'Courier New', Courier, monospace;">ext4</span> filesystem it is time to reduce the logical volume size accordingly. To achieve this the <span style="font-family: 'Courier New', Courier, monospace;">lvreduce</span> tool is employed. The <span style="font-family: 'Courier New', Courier, monospace;">-L</span> switch specifies final size of the logical volume which should match the size of the <span style="font-family: 'Courier New', Courier, monospace;">ext4</span> filesystem. <br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># lvreduce -L 30G /dev/mapper/vg_d620-lv_example</code></li>
<li><code>WARNING: Reducing active logical volume to 30.00 GiB<br />
THIS MAY DESTROY YOUR DATA (filesystem etc.)<br />
Do you really want to reduce lv_example? [y/n]: y<br />
Reducing logical volume lv_example to 30.00 GiB</code><code>Logical volume lv_example successfully resized</code></li>
</ol>
<br />
<h3>
5) Check if the resulting logical volume and filesystem are ok</h3>
Everything should have proceeded as planned however let's verify things. <span style="font-family: 'Courier New', Courier, monospace;">e2fsck</span> and <span style="font-family: 'Courier New', Courier, monospace;">resize2fs</span> are used verify the new filesystem, respectively. Notice that this time the <span style="font-family: 'Courier New', Courier, monospace;">resize2fs</span> doesn't specify any size, the goal here is to have the filesystem match the size of the logical volume.<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># e2fsck -f /dev/mapper/vg_d620-lv_example</code></li>
<li><code>e2fsck 1.41.12 (17-May-2010)<br />
Pass 1: Checking inodes, blocks, and sizes<br />
Pass 2: Checking directory structure<br />
Pass 3: Checking directory connectivity<br />
Pass 4: Checking reference counts<br />
Pass 5: Checking group summary information</code><code>/dev/mapper/vg_d620-lv_example: 11448/1966080 files (1.5% non-contiguous), 4658570/7864320 blocks</code></li>
<li><code># resize2fs -p /dev/mapper/vg_d620-lv_example</code></li>
<li><code>resize2fs 1.41.12 (17-May-2010)</code><code>The filesystem is already 7864320 blocks long. Nothing to do!</code></li>
</ol>
<br />
<h3>
6) Re-mount the logical volume</h3>
<div>
Finally, mount the updated logical volume: </div>
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># mount /dev/mapper/vg_d620-lv_example /mnt/example</code></li>
</ol>
<br />
It should be noted that if in step 4 <span style="font-family: 'Courier New', Courier, monospace;">e2fsck</span> fails because the partition is tool small <span style="font-family: 'Courier New', Courier, monospace;">lvextend</span> can be used to extend the logical volume until <span style="font-family: 'Courier New', Courier, monospace;">e2fsck</span> completes with success.<br />
<br />
Further information on <span style="font-family: 'Courier New', Courier, monospace;">lvm</span>, <span style="font-family: 'Courier New', Courier, monospace;">lvreduce</span>, <span style="font-family: 'Courier New', Courier, monospace;">lvextend,</span><span style="font-family: 'Courier New', Courier, monospace;">e2fsck</span> and <span style="font-family: 'Courier New', Courier, monospace;">resize2fs</span> can be obtained in the associated <span style="font-family: 'Courier New', Courier, monospace;">man</span> pages.tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com9tag:blogger.com,1999:blog-5845321515990016322.post-5052058641312187502012-05-28T20:10:00.001+01:002012-07-11T23:28:16.723+01:00HowTo: Mount UFS partition on CentOS / SL 6.2By default RHEL clones such as CentOS and Scientific Linux don't come with UFS filesystem support.<br />
<br />
However the ELRepo repository has the <span style="font-family: 'Courier New',Courier,monospace;">kmod-ufs</span>
package which provides the much needed kernel module. As such enabling
ufs support on RHEL/CentOS/SL 6.2 consists of adding the ELRepo
repository, installing and loading the kernel module for UFS.<br />
<br />
The required steps are: <style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>$ su</code></li>
<li><code># rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org</code></li>
<li><code># rpm -Uvh http://elrepo.org/elrepo-release-6-4.el6.elrepo.noarch.rpm</code></li>
<li><code># yum update</code></li>
<li><code># yum install kmod-ufs</code></li>
<li><code># modprobe ufs</code></li>
</ol>
<br />
Now that we have kernel support for UFS let's proceed to identify the partition(s) with UFS filesystems:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># fdisk -l /dev/sdb</code></li>
</ol>
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">
Disk /dev/sdb: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x90909090
Device Boot Start End Blocks Id System
/dev/sdb1 1 1968 15807928+ 7 HPFS/NTFS
/dev/sdb2 1969 7067 40957717+ a5 FreeBSD
/dev/sdb3 * 7068 12166 40957717+ a5 FreeBSD </code></pre>
<br />
In the BSD world slices are subdivided into partitions. Where Linux <span style="font-family: 'Courier New',Courier,monospace;">fdisk</span> sees a FreeBSD partition that partition is in fact a BSD slice with internal partitions. Taking a peek at the output of <span style="font-family: 'Courier New',Courier,monospace;">/var/log/messages</span> helps in identifying which are partitions that can be mounted.<br />
<br />
For example in my system: <br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># grep /dev/sdb /var/log/messages</code></li>
</ol>
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> May 24 21:44:33 athon kernel: sda5 sdb2: <bsd: sdb5 sdb6 sdb7 sdb8 sdb9 >
May 24 21:44:33 athon kernel: sda6 sda7 sda8 sdb3: <bsd: sdb10 sdb11 sdb12 sdb13 >
May 28 19:39:09 athon kernel: sda5 sda6 sdb2: <bsd: sdb5 sdb6 sdb7 sdb8 sdb9 >
May 28 19:39:09 athon kernel: sda7 sda8 sdb3: <bsd: sdb10 sdb11 sdb12 sdb13 > </code></pre>
<br />
What does this mean? <span style="font-family: 'Courier New',Courier,monospace;">sdb2</span>, <span style="font-family: 'Courier New',Courier,monospace;">sdb3</span>, <span style="font-family: 'Courier New',Courier,monospace;">sdb5</span>, <span style="font-family: 'Courier New',Courier,monospace;">sdb6</span>, <span style="font-family: 'Courier New',Courier,monospace;">sdb7</span>, <span style="font-family: 'Courier New',Courier,monospace;">sdb8</span>, <span style="font-family: 'Courier New',Courier,monospace;">sdb9</span>, <span style="font-family: 'Courier New',Courier,monospace;">sdb10</span>, <span style="font-family: 'Courier New',Courier,monospace;">sdb11</span>, <span style="font-family: 'Courier New',Courier,monospace;">sdb12</span> and <span style="font-family: 'Courier New',Courier,monospace;">sdb13</span> are FreeBSD UFS partitions.<br />
<br />
To mount a FreeBSD UFS partition:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># mount -t ufs -o ufstype=ufs2,ro /dev/sdb2 /mnt/</code></li>
</ol>
<br />
In which <span style="font-family: 'Courier New',Courier,monospace;">-t ufs -o ufstype=ufs2,ro</span> identify the UFS filesystem as being UFS2 and mounted as read-only.tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com6tag:blogger.com,1999:blog-5845321515990016322.post-33983993229680247292012-05-20T19:46:00.001+01:002014-04-17T22:52:18.043+01:00HowTo: Enemy Territory on x86_64 CentOS 6.2 / SL 6.2<b><i>Update 21/05/2012:</i></b><br />
<i>I'm getting Punkbuster kicked out of the game by random game integrity violations. I'm trying to identify a solution, until then I figure what's wrong I can't recommend following this how-to.</i><br />
<i>If you're reading this and manage to fix the problem, please let me know in the comments.</i><br />
<b><i>Update 04/06/2012:</i></b>
<br />
<i>Installed ET on Ubuntu 12.04 x86_64 both the manual way and using the get-deb package and the result is the same: random PB kick on servers running Punkbuster.</i><br />
<br />
Wolfenstein: Enemy Territory is a free multiplayer FPS that takes
place in the World World II pitting two teams (Allies and Axis) against
each other for victory.<br />
<br />
In this post I'll detail the steps required to install and update Enemy Territory on 64-bit CentOS, namely:<br />
1) Download the necessary files<br />
2) Install i686 libraries <br />
3) Install and update Enemy Territory<br />
4) Install updated Punkbuster files<br />
5) Generate an etkey<br />
6) Fix sound problem<br />
7) Setup widescreen resolution<br />
8) Bonus section: troubleshooting <br />
<br />
It should be noted that the steps
were performed on CentOS 6.2 x86_64 thus should translate to RHEL and Scientific Linux..<br />
<br />
<h3>
1) Download Enemy Territory 2.60 and 2.60b update</h3>
Download <span style="font-family: 'Courier New', Courier, monospace;">et-linux-2.60.x86.run</span>, <span style="font-family: 'Courier New', Courier, monospace;">et-2.60b.zip</span> update, updated Punkbuster and the <span style="font-family: 'Courier New', Courier, monospace;">et-sdl-sound.gz</span> sound fix:<code> </code><br />
<code></code><style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code>$ wget -c http://ftp.freenet.de/pub/4players/hosted/et/official/et-linux-2.60.x86.run</code></li>
<li><code>$ wget -c ftp://ftp.idsoftware.com/idstuff/et/ET-2.60b.zip</code></li>
<li><code>$ wget -c http://etkey.org/et_linux.zip</code></li>
<li><code>$ wget -c http://nullkey.kapsi.fi/~stuff/et-sdl-sound/et-sdl-sound.gz</code></li>
</ol>
<br />
<h3>
2) Install i686 libraries</h3>
Enemy Territory is a 32-bit application as such for a 64-bit CentOS a few i686 libraries are needed:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code># yum install glibc.i686 libX11.i686 libXext.i686 libstdc++.i686 pulseaudio-libs.i686</code></li>
</ol>
<br />
Enemy Territory requires 3D acceleration which commonly implies NVIDIA or AMD/ATI graphic cards and associated proprietary drivers.<br />
<br />
User of NVIDIA cards are required to install <span style="font-family: 'Courier New', Courier, monospace;">nvidia-x11-drv-32bit</span> which provides the compatibility 32-bit files for the 64-bit proprietary NVIDIA driver:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code># yum install nvidia-x11-drv-32bit</code></li>
</ol>
<br />
I'd assume that users of AMD/ATI graphics card need to install <span style="font-family: 'Courier New', Courier, monospace;">fglrx-x11-drv-32bit</span> which provides similar files for the proprietary AMD driver, however I don't have an AMD/ATI card to verify.<br />
<br />
<h3>
3) Install and update Enemy Territory</h3>
Change to root, attribute
execute permissions to the installer, install Enemy Territory 2.60,
install the 2.60b update, create a profile and check the game's version: <br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code>$ su</code></li>
<li><code># chmod +x et-linux-2.60.x86.run</code></li>
<li><code>#./et-linux-2.60.x86.run</code></li>
</ol>
<br />
Press <b>OK</b> in the popup. Agree with the <b>License Agreement</b> by pressing ENTER at the <b>License Agreement</b> prompt and choosing <b>YES</b> on <b>"Do you agree with the license?"</b> popup that follows. Choose <b>NO</b> at the <b>"Would you like to read the CHANGES file?"</b> popup. You can always read the <span style="font-family: 'Courier New', Courier, monospace;">CHANGES</span> file latter on if you want. Choose the installation path and press <b>OK</b> in the <b>Symlink Path</b> popup. Install both <b>Enemy Territory</b> and <b>Punkbuster</b>.
Choose to install the startup menu entries. After this the game
installs. Don't choose to start the game immediately as we haven't
finished installing everything.<br />
<br />
Install the 2.60b update:<code></code><br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code># unzip et-2.60b.zip</code></li>
<li><code># cp Enemy\ Territory\ 2.60b/linux/* /usr/local/games/enemy-territory/</code></li>
<li><code># exit</code></li>
</ol>
<br />
Now start the game, create a player profile identifying profile name, connection speed and clicking on <b>Enable Punkbuster</b>; exit the game. By doing so a <span style="font-family: 'Courier New', Courier, monospace;">.etwolf</span> directory will be created in your home directory which includes a folder containing PunkBuster.<br />
<br />
Inside the game you can check the installed version by pulling the console down by pressing <span style="font-family: 'Courier New', Courier, monospace;">~</span> and typing <span style="font-family: 'Courier New', Courier, monospace;">version</span>. It should output the following:<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> ]\version
"version" is:"ET 2.60b linux-i386 May 8 2006" default:"ET 2.60b linux-i386 May 8 2006" </code></pre>
<br />
<h3>
4) Install updated Punkbuster files</h3>
Remove old Punkbuster files, extract the last Punkbuster update and place it in the created profile:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code>$ rm -rf ~/.etwolf/etmain/pb</code></li>
<li><code>$ unzip et_linux.zip -d pb</code></li>
<li><code>$ cp -R pb ~./etwolf/etmain/</code></li>
</ol>
<br />
<h3>
5) Generate an etkey</h3>
Point to <a href="http://etkey.org/pages/etkey-home.php">http://etkey.org/pages/etkey-home.php</a>, press the <b>Get an ETKEY</b> button, download the file and store it under <span style="font-family: 'Courier New', Courier, monospace;">~./etwolf/etmain/</span>.<br />
<br />
<h3>
6) Fix sound problem</h3>
The most dreadful any Linux Enemy Territory player can witness:<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> ------- sound initialization -------
/dev/dsp: No such file or directory
Could not open /dev/dsp
------------------------------------ </code></pre>
Luckily we can use the <span style="font-family: 'Courier New', Courier, monospace;">SDL</span> backend which Enemy Territory will use as audio device replacing <span style="font-family: 'Courier New', Courier, monospace;">/dev/dsp</span> and OSS.<br />
<br />
Install
<span style="font-family: 'Courier New', Courier, monospace;">SDL</span>, extract the <span style="font-family: 'Courier New', Courier, monospace;">et-sdl-sound</span> script, make it executable and accessible
to all and edit the et launcher to have Enemy Territory use SDL instead
of OSS:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code># yum install SDL.i686</code></li>
<li><code># gzip -d et-sdl-sound.gz</code></li>
<li><code># chmod a+x et-sdl-sound</code></li>
<li><code># chown root:root et-sdl-sound</code></li>
<li><code># mv et-sdl-sound /usr/local/games/enemy-territory/</code></li>
<li><code># vim /usr/local/games/enemy-territory/et</code></li>
</ol>
<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> #!/bin/sh
# Needed to make symlinks/shortcuts work.
# the binaries must run with correct working directory
cd "/usr/local/games/enemy-territory/"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.
./et-sdl-sound "$@" </code></pre>
<br />
The <span style="font-family: 'Courier New', Courier, monospace;">et-sdl-sound</span> script needs to be edit so that PulseAudio is used has the SDL audio driver.<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code># vim /<br />usr/local/games/enemy-territory/et-sdl-sound</code></li>
</ol>
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> Replace
SDL_AUDIODRIVER="alsa"
with
SDL_AUDIODRIVER="pulse"</code></pre>
<br />
<h3>
7) Setup widescreen resolution</h3>
If you have a widescreen monitor follow the instructions on my previous blog post <a href="http://linux-bsd-sharing.blogspot.pt/2008/08/enemy-territory-on-widescreen-monitor.html">HowTo: Widescreen resolutions on Enemy Territory</a>.<br />
<br />
And we're done installing Enemy Territory!<br />
<br />
Lately I've been playing at [fp].:Demolition_Centre as tangram"FreeBSD~ or tangram"GNU/Linux~. See you on the battlefield :D<br />
<br />
<h3>
8) Bonus section: troubleshooting</h3>
Error:<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipB5kKczvqyZjC5-0zCD3w4vqzrtGRvxpY4cZAyGs_aPtjFGVJhwCLIWxcJSDR-3nZHP7Gr-THMSBs3G4x1og6whybcin_wkuD0KOz36kYQ0QcDYeXMPBECY-7noVYT3FOZwxFX99Gb3wL/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory </code></pre>
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code># yum install glibc.i686</code></li>
</ol>
<br />
Error:<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipB5kKczvqyZjC5-0zCD3w4vqzrtGRvxpY4cZAyGs_aPtjFGVJhwCLIWxcJSDR-3nZHP7Gr-THMSBs3G4x1og6whybcin_wkuD0KOz36kYQ0QcDYeXMPBECY-7noVYT3FOZwxFX99Gb3wL/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> ./et.x86: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory </code></pre>
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code># yum install libX11.i686</code></li>
</ol>
<br />
Error:<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipB5kKczvqyZjC5-0zCD3w4vqzrtGRvxpY4cZAyGs_aPtjFGVJhwCLIWxcJSDR-3nZHP7Gr-THMSBs3G4x1og6whybcin_wkuD0KOz36kYQ0QcDYeXMPBECY-7noVYT3FOZwxFX99Gb3wL/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> ./et.x86: error while loading shared libraries: libXext.so.6: cannot open shared object file: No such file or directory </code></pre>
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code># yum install libXext.i686</code></li>
</ol>
<br />
Error:<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipB5kKczvqyZjC5-0zCD3w4vqzrtGRvxpY4cZAyGs_aPtjFGVJhwCLIWxcJSDR-3nZHP7Gr-THMSBs3G4x1og6whybcin_wkuD0KOz36kYQ0QcDYeXMPBECY-7noVYT3FOZwxFX99Gb3wL/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> ----- Client Initialization Complete -----
----- R_Init -----
...loading libGL.so.1: QGL_Init: dlopen libGL.so.1 failed: libGL.so.1: cannot open shared object file: No such file or directory
failed
----- CL_Shutdown -----
RE_Shutdown( 1 )
-----------------------
----- CL_Shutdown -----
-----------------------
Sys_Error: GLimp_Init() - could not load OpenGL subsystem </code></pre>
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code># yum install nvidia-x11-drv-32bit</code></li>
</ol>
<br />
or<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code># yum install fglrx-x11-drv-32bit</code></li>
</ol>
<br />tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com0tag:blogger.com,1999:blog-5845321515990016322.post-33495098662248384612012-05-19T19:38:00.001+01:002012-08-16T21:47:57.033+01:00HowTo: Install VirtualBox on CentOS 6.2 / SL 6.2Oracle VM VirtualBox is an popular<a href="http://en.wikipedia.org/wiki/X86_virtualization"></a> software package that once installed on an existing host operating system allowing for additional guest operating systems to be loaded and run, each with its own virtual environment.<br />
<br />
In this post I'll go over the steps needed to install it on RHEL clones such as CentOS and Scientific Linux.<br />
<br />
In summary, we start by downloading VirtualBox's YUM repository file and placing it in the appropriate directory, afterwards we install the <span style="font-family: 'Courier New', Courier, monospace;">dkms</span> and <span style="font-family: 'Courier New', Courier, monospace;">VirtualBox-4.1</span> packages and conclude by adding your user to be <span style="font-family: 'Courier New', Courier, monospace;">vboxusers</span> group.<br />
<br />
Let's begin by fetching the repo file and placing it under <span style="font-family: 'Courier New', Courier, monospace;">/etc/yum.repos.d/</span>:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>$ wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo</code></li>
<li><code>$ su</code></li>
<li><code># mv virtualbox.repo /etc/yum.repos.d/</code></li>
</ol>
<br />
Afterwards, installing <span style="font-family: 'Courier New', Courier, monospace;">dkms</span> will bring in <span style="font-family: 'Courier New', Courier, monospace;">cloog-ppl</span>, <span style="font-family: 'Courier New', Courier, monospace;">cpp</span>, <span style="font-family: 'Courier New', Courier, monospace;">gcc</span>, <span style="font-family: 'Courier New', Courier, monospace;">glibc-deve</span>l, <span style="font-family: 'Courier New', Courier, monospace;">glibc-headers</span>, <span style="font-family: 'Courier New', Courier, monospace;">kernel-devel</span>, <span style="font-family: 'Courier New', Courier, monospace;">kernel-headers</span>, <span style="font-family: 'Courier New', Courier, monospace;">libgomp</span>, <span style="font-family: 'Courier New', Courier, monospace;">make</span>, <span style="font-family: 'Courier New', Courier, monospace;">mpfr</span> and <span style="font-family: 'Courier New', Courier, monospace;">ppl</span>. These are needed to have VirtualBox match the kernel.<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code># yum install dkms</code></li>
</ol>
<br />
Then we move to installing VirtualBox itself.<br />
<br />
For 32 bits systems use:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># yum install VirtualBox-4.1.i686</code></li>
</ol>
<br />
In the case of 64 bits systems: <br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code># yum install VirtualBox-4.1.x86_64</code></li>
</ol>
<br />
Wrap up by adding your user to the <span style="font-family: 'Courier New', Courier, monospace;">vboxusers</span> and rebooting the computer:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code># usermod -a -G vboxusers ricardo</code></li>
<li><code># reboot</code></li>
</ol>
<br />
Just in case, make sure to check and see if your computer BIOS has virtualization support disabled. More often that not, motherboard have it disabled.tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com0tag:blogger.com,1999:blog-5845321515990016322.post-23517238585350029642012-05-19T18:19:00.001+01:002012-11-16T14:00:15.359+00:00HowTo: Install Dropbox using Repoforge on CentOS 6.2 / SL 6.2Dropbox is a Web-based file hosting service that uses networked storage provided by <i>Dropbox, Inc</i> to enable users to store and share files and folders with others across the Internet using file synchronization.<br />
<br />
The good folks that maintain the Repoforge (also know as RPMforge) repository have added packages for Dropbox.<br />
<br />
What does this mean? No need for <a href="http://linux-bsd-sharing.blogspot.pt/2012/04/howto-install-dropbox-on-centos-62-and.html">workaround for using Dropbox's Fedora repository on CentOS / SL / RHEL</a>.<br />
<br />
This post assumes that you already have a Dropbox account, if you don't get one <a href="http://db.tt/eS5Npbk">here</a>.<br />
<br />
If you're running a 32 bits system:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>$ su</code></li>
<li><code># rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt</code></li>
<li><code># rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm</code></li>
<li><code># yum install nautilus-dropbox</code></li>
</ol>
<br />
On the other hand, if you have a 64 bits install issue the following commands:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>$ su</code></li>
<li><code># rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt</code></li>
<li><code># rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm</code></li>
<li><code># yum install nautilus-dropbox</code></li>
<li><code># echo '-b /usr/libexec/dropbox/' >/etc/prelink.conf.d/dropbox.conf</code></li>
</ol>
<br />
Users of 64 bit systems are required an extra step otherwise Dropbox will fail after reboot because prelink 'optimises' executables during bootup, however Dropbox has issues with those optimizations.<br />
<br />
As part of installing the <span style="font-family: "Courier New",Courier,monospace;">rpm</span> package you'll be forced to restart Nautilus, afterwards point to <b>Applications -> Internet</b> and launch the new Dropbox entry.<br />
<br />
A series of Dropbox installation windows will guide you during the
rest of the setup.<br />
<br />
To wrap-up add the username(s) that will use Dropbox on <span style="font-family: "Courier New",Courier,monospace;">/etc/sysconfig/dropbox</span>. For example, if the users that will use Dropbox are <span style="font-family: "Courier New",Courier,monospace;">john</span> and <span style="font-family: "Courier New",Courier,monospace;">jane</span>:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># vim /etc/sysconfig/dropbox</code></li>
<li><code>DROPBOX_USERS=john,jane</code></li>
</ol>
<br />
Now be patient, in a matter of minutes you'll have a synchronized
Dropbox folder :)tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com4tag:blogger.com,1999:blog-5845321515990016322.post-73351607409748373792012-05-19T17:47:00.000+01:002012-07-15T16:00:32.616+01:00HowTo: Install Adobe Flash Player on CentOS 6.2 x86_64<i><b>Update 15-07-2012:</b> the folks at the Repoforge have added
flash-plugin to their repository. If you prefer to use their package
follow the instructions at <a href="http://linux-bsd-sharing.blogspot.pt/2012/07/howto-install-adobe-flash-player-using.html">http://linux-bsd-sharing.blogspot.pt/2012/07/howto-install-adobe-flash-player-using.html</a>.</i><br />
<i> </i> <br />
Ever since I've upgraded my Dell D620 from an Intel Core Duo T2300E to a Core 2 Duo T7200 I've grown to be "64 bits conscious". As a result today I'll explain how to install Adobe Flash Player in CentOS 6.2 x86_64.<br />
<br />
To install Adobe Flash Player on a RHEL 6.2 clone, you'll need to change to root, install Adobe's YUM repository, import the associated GPG key and install Adobe Flash Player for x86_64.<br />
<br />
For a 64 bits CentOS 6.2 installation, run the following commands:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; } .code code { display: block; padding: 3px; margin-bottom: 0; } .code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style> <br />
<ol class="code">
<li><code>$ su</code></li>
<li><code># rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm</code></li>
<li><code># rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux</code></li>
<li><code># yum install flash-plugin</code></li>
</ol>
<br />
If you're running i386 you can install Adobe Flash Player following the instructions I've laied out <a href="http://linux-bsd-sharing.blogspot.pt/2012/04/howto-install-adobe-flash-player-on.html">here</a>.<br />
<br />
Launch Mozilla Firefox and in the address bar enter <span style="font-family: 'Courier New',Courier,monospace;">about:plugins</span>. An Shockwave Flash entry should be available.<br />
<br />
If you point to <b><i>System -> Preferences</i></b> you'll notice that a new entry named <i><b>Adobe Flash Player</b></i> is now available. <br />
<br />
You can test if the plugin is working by visiting <a href="http://www.adobe.com/software/flash/about">http://www.adobe.com/software/flash/about</a> or by firing up a random Youtube clip.tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com1tag:blogger.com,1999:blog-5845321515990016322.post-30827303267300074082012-05-13T00:01:00.001+01:002012-08-16T21:48:42.831+01:00HowTo: Install and run NetBSD on VirtualboxNetBSD attracts me.<br />
<br />
Maybe it's the philosophy being it... or maybe it just the old BSD daemon holding the flag on top of computer. Regardless of the reason, I've been toying with the idea of installing NetBSD on my Athon XP 3200+ nForce2 old desktop for a while now. <br />
<br />
However the only instructions I found to convert a NetBSD 5.1.2 CD image into an USB bootable install medium involved using NetBSD. This chicken-egg dilema lead me to VirtualBox 4.1.14.<br />
<br />
Just a few seconds after booting the install image into the VirtualBox machine it kernel panicked with the following error:<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> uvm_fault(0xc0b82a00, 0, 1) -> 0xe
fatal page fault in supervisor mode
trap type 6 code 0 eip c0100d27 cs 8 eflags 3046 cr2 0 ilevel 1
kernel: supervisor trap page fault, code=0
Stopped in pid 0.19 (system) at netbsd:Xspllower+0x17: addb %al,0(%eax)
db{0} </code></pre>
Just the luck heh?<br />
<br />
The workaround? VBoxSDL.<br />
<br />
VBoxSDL is a simple graphical user interface (GUI) that lacks the nice point-and-click support which VirtualBox, our main GUI, provides. VBoxSDL is currently primarily used internally for debugging VirtualBox and therefore not officially supported.<br />
<br />
To be able to install NetBSD 5.1.2 on VirtualBox 4.1.14, assuming the virtual machine is name "NetBSD", you'll have to use VBoxSDL like this:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; } .code code { display: block; padding: 3px; margin-bottom: 0; } .code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style> <br />
<ol class="code">
<li><code>$ VBoxSDL --norawr0 --startvm NetBSD</code></li>
</ol>
<br />
Now you'll be able to install NetBSD without any issues.<br />
<br />
The problem is when you, in your sweet innocence, reboot the system and VirtualBox isn't able to start the vm stating that:<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> Failed to open a session for the virtual machine NetBSD.
The virtual machine 'NetBSD' has terminated unexpectedly during startup because of signal 11.
Details
Result Code: NS_ERROR_FAILURE (0x80004005)
Component: Machine
Interface: IMachine {5eaa9319-62fc-4b0a-843c-0cb1940f8a91} </code></pre>
<br />
The workaround? Yes you've guessed... VBoxSDL:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; } .code code { display: block; padding: 3px; margin-bottom: 0; } .code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style> <br />
<ol class="code">
<li><code>$ VBoxSDL --nopatm --startvm NetBSD</code></li>
</ol>
<br />
Peace at last. I can finally muck around NetBSD :D<br />
<br />
For reference:<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> --[no]rawr0 Enable or disable raw ring 3
--[no]patm Enable or disable PATM </code></pre>
Sources:<br />
<a href="http://download.virtualbox.org/virtualbox/UserManual.pdf">http://download.virtualbox.org/virtualbox/UserManual.pdf</a><br />
<a href="http://chvnx.com/post/18341637412/netbsd-in-virtualbox%20">http://chvnx.com/post/18341637412/netbsd-in-virtualbox </a><br />
<span style="font-family: "Courier New",Courier,monospace;">VBoxSDL --help</span>tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com4tag:blogger.com,1999:blog-5845321515990016322.post-6084347478731724272012-05-12T23:13:00.000+01:002012-05-12T23:13:22.715+01:00Tip: Merge PDF files into a single PDF using PdftkIn a previous post I've explained <a href="http://linux-bsd-sharing.blogspot.pt/2012/05/tip-split-selected-pages-from-pdf.html">how to extract pages from a PDF document</a>.<br />
<br />
Funny enough a few days latter I needed to merge some PDF files into a single document, instead of hunting the web for a Windows application to do that (I have to use Windows at work) I used <span style="font-family: "Courier New",Courier,monospace;">scp</span> to send the files to the home server, ran <span style="font-family: "Courier New",Courier,monospace;">pdftk</span> there and <span style="font-family: "Courier New",Courier,monospace;">scp</span> the merged PDF back ;)<br />
<br />
So today I'll use Pdftk this time to merge several PDF documents into a single PDF.<br />
<br />
Start by installing Pdftk if you haven't using your distributions package manager:<br />
<ul>
<li>Instructions for installing Pdftk for FreeBSD can be found <a href="http://linux-bsd-sharing.blogspot.pt/2012/05/tip-split-selected-pages-from-pdf.html">here</a>. </li>
<li>If you are using a Debian based distribution issue <span style="font-family: "Courier New",Courier,monospace;">apt-get install pdftk</span>.</li>
<li>Users of RPM distribution's such as RHEL, CentOS, Scientific Linux and Fedora can install it by running <span style="font-family: "Courier New",Courier,monospace;">yum install pdftk</span>.</li>
<li>To install the program on Gentoo use <span style="font-family: "Courier New",Courier,monospace;">emerge pdftk</span>.</li>
</ul>
Now onto using Pdftk for our purpose!<br />
<br />
The steps to merge PDF documents into a single PDF consist of:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>$ cd change_to_directory_with_target_pdfs</code></li>
<li><code>$ pdftk first.pdf second.pdf third.pdf cat output merged-pdf.pdf</code></li>
</ol>
<br />
The PDF should be listed in the order in which they are to be placed in the final document. More information on Pdftk can be found using <span style="font-family: "Courier New",Courier,monospace;">man pdftk</span>.tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com0tag:blogger.com,1999:blog-5845321515990016322.post-18374301900233325732012-05-07T23:20:00.000+01:002012-05-07T23:20:40.123+01:00Tip: Split selected pages from PDF document using PdftkPdftk is a simple tool for manipulating PDF documents that runs in FreeBSD, Linux, Mac OS X, Solaris and Windows. With it the user can merge PDF documents, repair corrupted PDF, rotate PDF pages or document and extract selected pages from a PDF document creating a new document among other features.<br /><br /><a href="http://bsdmag.org/">BSD Magazine</a> is a great and free magazine that deals with a wide range of BSD related subjects. The latest issue had a particular article that I felt I wanted to keep close to me.<br /><br />Using Pdftk I was able to extract the pages that composed the article and keep it in a new PDF document.<br /><br />Installing Pdftk on FreeBSD is a matter of changing to the <a href="http://www.freshports.org/print/pdftk/">print/pdftk</a> port and issuing <span style="font-family: "Courier New",Courier,monospace;">make install clean</span>, like so:<br /><style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>$ su</code></li>
<li><code># cd /usr/ports/print/pdftk</code></li>
<li><code># make install clean</code></li>
</ol>
<br />
Make sure to build <a href="http://www.freshports.org/lang/gcc46/">lang/gcc46</a> with the <span style="font-family: "Courier New",Courier,monospace;">JAVA Enable the Java frontend (i386 and amd64 only) OPTION</span> selected or else the build process will fail (take it from me I learned it the hard way).<br /><br />If you prefer to use packages instead of the ports tree, issue the following commands instead:<br /><style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>$ su</code></li>
<li><code># pkg_add -r pdftk</code></li>
</ol>
<br />Now for the fun part: using Pdftk on the this months' BSD Magazine as an example. Start by downloading BSD Magazine 5/2012 issue which you can find <a href="http://bsdmag.org/magazine/1800-bsd-security-protect-your-bsd">here</a>.<br /><br />I wanted to extract the <i>Hardening FreeBSD with TrustedBSD and Mandatory Access Controls</i> article which runs from page 46 to 49, this how to do it using Pdftk:<br /><style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code>$ pdftk 'BSD_05_2012.pdf' cat 46-49 output 'Hardening-FreeBSD-with-TrustedBSD-and-MAC.pdf'</code></li>
</ol>
<br />You can find plenty of other uses for Pdftk in applications man page:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<ol class="code">
<li><code>$ man pdftk</code></li>
</ol>tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com0tag:blogger.com,1999:blog-5845321515990016322.post-68630631937718086552012-05-05T16:59:00.003+01:002012-05-05T18:46:35.203+01:00Tip: Disable Compiz hot cornerDid you ever reached for the window close and have Compiz display all open windows? Well to me it happened one time too many until I decided I wanted to disable that "feature".<br />
<br />
The culprit is the Compiz's scale plugin and the <span style="font-family: "Courier New",Courier,monospace;">initiate_edge</span> option which initiates Compiz's Window Picker.<br />
<br />
However there a couple of ways of disabling the hot corner or assigning another corner than the default top right corner: <br />
<ol>
<li>Issue the appropriate <span style="font-family: "Courier New",Courier,monospace;">gconftool-2</span> command</li>
<li>Install and run <span style="font-family: "Courier New",Courier,monospace;">gconf-editor</span></li>
<li>Or install and use <span style="font-family: "Courier New",Courier,monospace;">ccsm</span></li>
</ol>
As methods 2 and 3 imply installing further packages or even enabling a new repository (method 3), I'll explain how to use <span style="font-family: "Courier New",Courier,monospace;">gconftool-2</span> to achieve our goal.<br />
<br />
To disable the hot corner:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>$ gconftool-2 --type string --set /apps/compiz/plugins/scale/allscreens/options/initiate_edge Disabled</code></li>
</ol>
<br />
If you like to hot corner "feature" and would like to move it to the top left corner:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>$ gconftool-2 --type string --set /apps/compiz/plugins/scale/allscreens/options/initiate_edge TopLeft</code></li>
</ol>
<br />
To change the hot corner to the bottom left corner:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>$ gconftool-2 --type string --set /apps/compiz/plugins/scale/allscreens/options/initiate_edge BottomLeft</code></li>
</ol>
<br />
You can also change the hot corner to the bottom right corner:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>$ gconftool-2 --type string --set /apps/compiz/plugins/scale/allscreens/options/initiate_edge BottomRight</code></li>
</ol>
<br />
To re-enable the default hot corner to the top right corner:<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code>$ gconftool-2 --type string --set /apps/compiz/plugins/scale/allscreens/options/initiate_edge TopRight</code></li>
</ol>
<br />
This procedure was executed under CentOS 6.2 thus being applicable to Scientific Linux and RHEL however it can also applied to other Unix-like distributions.tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com6tag:blogger.com,1999:blog-5845321515990016322.post-82349804756529880762012-05-02T16:16:00.002+01:002012-05-03T17:35:55.321+01:00Tip: Fix nmap "Error compiling our pcap filter: icmp7 not supported" on FreeBSDI was going to start Nmap 5.61TEST5 on FreeBSD when it bricked with the following error:<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> Starting Nmap 5.61TEST5 ( http://nmap.org ) at 2012-05-02 15:17 WEST
Error compiling our pcap filter: icmp6 not supported </code></pre>
Found that weird because last time I used <a href="http://www.freshports.org/security/nmap/">security/nmap</a> it worked fine but then again that was something like 3 years ago and the port and the application have been updated since. This lead me to think that most likely an <span style="font-family: "Courier New",Courier,monospace;">OPTION</span> had been introduced to the port:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># cd /usr/ports/security/nmap</code></li>
<li><code># make config</code><code>===> No options to configure</code></li>
</ol>
<br />
While investigating the issue I came across problem report <a href="http://www.freebsd.org/cgi/query-pr.cgi?pr=159376">ports/159376: security/nmap 5.59BETA1 not working</a> which described the cause of the problem: since NMAP 5.59BETA1 that there was no option to build the port without IPv6 support.<br />
<br />
I was pretty sure I've disabled IPv6 and I confirmed that:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># grep INET6 /etc/src.conf</code><code>WITHOUT_INET6=YES</code></li>
</ol>
<br />
Fortunately since NMAP 5.61TEST2 a patch was added that introduced a workaround for systems build with <span style="font-family: "Courier New",Courier,monospace;">WITHOUT_INET6 by using </span><a href="http://www.freshports.org/net/libpcap">net/libpcap</a>.<br />
<br />
This is also documented under <span style="font-family: "Courier New",Courier,monospace;">/usr/ports/security/nmap/Makefile</span>:<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> # XXX: Workaround if OS is build with WITHOUT_INET6
# PR: ports/159376
#
# Note: If this option is specified in src.conf it has to
# be defined as param -DWITHOUT_INET6 during build time
# since the port system has no access to src.conf
.if defined(WITHOUT_INET6)
LIB_DEPENDS+= pcap.1:${PORTSDIR}/net/libpcap
CONFIGURE_ARGS+= --with-libpcap=${LOCALBASE}
.endif</code></pre>
The <span style="font-family: "Courier New",Courier,monospace;">-DWITHOUT_INET6</span> option needs to be passed to make while building the port, like so:<br />
<style type="text/css">
.code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; }
.code code { display: block; padding: 3px; margin-bottom: 0; }
.code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; }
</style>
<br />
<ol class="code">
<li><code># make deinstall clean</code></li>
<li><code># make -DWITHOUT_INET6 install clean</code></li>
</ol>
<br />
Nothing like well documented problem reports and Makefiles ;)tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com0tag:blogger.com,1999:blog-5845321515990016322.post-79597887432967057052012-04-29T11:52:00.003+01:002012-04-29T11:52:51.303+01:00HowTo: Sharing Android smartphone 3G connection with CentOS 6.2I have a LG P500 Android smartphone running Gingerbread 2.3.3 and I've been meaning to try out if I could share the phone's 3G connection with my CentOS 6.2 laptop. Turns out that it is super easy to do so :)<br /><br />In this post I'll explain the 2 methods that can be used to share your Android smartphone connection with CentOS 6.2 machine:<ol>
<li>USB tethering, wired connection</li>
<li>Portable Wi-Fi hotspot, wireless connection</li>
</ol>
Though this procedure was executed on Gingerbread 2.3.3 and CentOS 6.2 it should apply to other Android versions as well as other Linux distributions equipped with Network Manager.<br />
<br />
<h3>
USB tethering</h3>
Activate the 3G data connection on the Android smartphone, connect the USB cable to the Android device and then to your computer. On the Android smartphone go to <i><b>Settings</b></i> -> <i><b>Wireless & networks</b></i> -> <i><b>Tethering & portable hotspot</b></i> and activate <i><b>USB tethering</b></i>.<br /><br />CentOS' Network Manager with automatically create a wired connection assigning the <span style="font-family: "Courier New",Courier,monospace;">cdc_ether</span> driver to the USB device thus creating an ethernet interface such as <span style="font-family: "Courier New",Courier,monospace;">usb0</span>.<br /><br />When your done just disable the 3G data connection or disable <i><b>USB tethering</b></i> on the Android smartphone.<br /><br />
<h3>
Portable Wi-Fi hotspot</h3>
Activate the 3G data connection on the Android smartphone and go to <i><b>Settings </b></i>-> <i><b>Wireless & networks</b></i> -> <i><b>Tethering & portable hotspot</b></i> and activate <i><b>Portable Wi-Fi hotspot</b></i>.<br /><br />Tap the <i><b>Portable Wi-Fi hotspot settings</b></i> and then <b><i>Configure Wi-Fi hotspot</i></b>. Type in a <i><b>Network SSID</b></i> such as MyAndroidAP, select <i><b>Security</b></i> and choose WPA2 PSK and type in a password in the <i><b>Password</b></i> field.<br /><br />CentOS' Network Manager will identify Android's wireless Network SSID, connect to it and a <i><b>Wireless Network Authentication Required</b></i> pop-up will appear. Select WPA & WPA2 Personal and type in the password that you've chosen while configuring the Android smartphone.<br /><br />To end the connection disable 3G or the <i><b>Portable Wi-Fi hotspot</b></i>.tangramhttp://www.blogger.com/profile/06588030231546523539noreply@blogger.com0