TOPIC: LINUX
Installing FreeBSD in a VirtualBox Virtual Machine
2nd March 2014With UNIX being the basis of Linux, I have a soft spot for trying out any UNIX that can be installed on a PC. For a while, I had OpenSolaris on the go and even vaguely recall having a look at one of the BSD's. However, any recent attempt to install one of the latter, and there are quite a few around now, got stymied by some sort of kernel panic caused by using AMD CPU's. With the return to the Intel fold arising from the upgrade of my main home PC last year, it perhaps was time to try again.
The recent release of FreeBSD 10.0 was the cue and I downloaded a DVD image for a test installation in a VirtualBox virtual machine with 4 GB of memory and a 32 GB virtual hard drive attached (expanding storage was chosen so not all the allocated space has been taken so far). The variant of FreeBSD chosen was the 64-bit x86 one, and I set to installing it in there. Though not as pretty in appearance as those in various Linux distros, the installer was not that user unfriendly to me. Mind you, I have experience of installing Arch Linux, which might have acclimatised me somewhat.
Those installation screens ask about the keyboard mapping that you want, and I successfully chose one of the UK options. There was limited opportunity for adding extras, though there was a short list of a few from which I made some selections. Given that user account set up also was on offer, I would have been better off knowing what groups to assign for my personal user account to have to avoid needing to log in as root so often following system start up later. Otherwise, all the default options were sufficient.
When the installation process was complete, it was time to boot into the new system and all that was on offer was a command line log in session. After logging in as root, it was time to press pkg
into service to get a desktop environment in place. The first step was to install X:
pkg install xorg
Then, it was time to install a desktop environment. While using XFCE or KDE were alternatives, I chose GNOME 2 due to familiarity and more extensive instructions on the corresponding FreeBSD handbook page. Issuing the following command added GNOME and all its helper applications:
pkg install gnome2
So that GNOME starts up at the next reboot, some extra steps are needed. The first of these is to add the following line into /etc/fstab
:
proc /proc procfs rw 0 0
Then, two lines were needed in /etc/rc.conf
:
gdm_enable="YES"
gnome_enable="YES"
The first enables the GNOME display manager, while the second activates other GNOME programs that are needed for a desktop session to start. With each of these in place, I got a graphical login screen at the next boot time.
With FreeBSD being a VirtualBox Guest, it was time to consult the relevant FreeBSD manual page. Here, there are sections for a number of virtual machine tools, so a search was needed to find the one for VirtualBox. VirtualBox support for FreeBSD is incomplete in that there is no installation media for BSD systems, while Linux and Solaris are supported along with Windows. Therefore, it is over to the FreeBSD repositories for the required software:
pkg install virtualbox-ose-additions
Aside from the virtual machine session not capturing and releasing the mouse pointer automatically, that did everything that was needed, even if it was the open source edition of the drivers and their proprietary equivalents. To resolve the mouse pointer issue, I needed to temporarily disable the GNOME desktop session in /etc/rc.conf
to drop to a console only session where xorg.conf
could be generated using the following commands:
Xorg -configure
cp xorg.conf.new /etc/xorg.conf
In the new xorg.conf
file, the mouse section needs to be as follows:
Section "InputDevice"
Identifier "Mouse0"
Driver "vboxmouse"
EndSection
If it doesn't look like the above, and it wasn't the case for me, then it needs changing. Also, any extra lines from the default set up also need removing, or the mouse will not function as it should. The ALT+F1 (for accessing GNOME menus) and ALT+F2 (for running commands) keyboard shortcuts then become crucial when your mouse is not working as it should and could avert a panic too; knowing that adjusting a single configuration file will resolve a problem when doing so is less accessible is not a good feeling as I discovered to my own cost. The graphics settings were fine by default, but here's what you should have in case it isn't for you:
Section "Device"
### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
### [arg]: arg optional
Identifier "Card0"
Driver "vboxvideo"
VendorName "InnoTek Systemberatung GmbH"
BoardName "VirtualBox Graphics Adapter"
BusID "PCI:0:2:0"
EndSection
The next step is to ensure that your HAL settings are as they should. I needed to create a file in /usr/local/etc/hal/fdi/policy
called 90-vboxguest.fdi
that contains the following:
<?xml version="1.0" encoding="utf-8"?>
<!--
# Sun VirtualBox
# Hal driver description for the vboxmouse driver
# $Id: chapter.xml,v 1.33 2012-03-17 04:53:52 eadler Exp $
Copyright (C) 2008-2009 Sun Microsystems, Inc.
This file is part of VirtualBox Open Source Edition (OSE, as
available from http://www.virtualbox.org. This file is free software;
you can redistribute it and/or modify it under the terms of the GNU
General Public License (GPL) as published by the Free Software
Foundation, in version 2 as it comes in the "COPYING" file of the
VirtualBox OSE distribution. VirtualBox OSE is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
Clara, CA 95054 USA or visit http://www.sun.com if you need
additional information or have any questions.
-->
<deviceinfo version="0.2">
<device>
<match key="info.subsystem" string="pci">
<match key="info.product" string="VirtualBox guest Service">
<append key="info.capabilities" type="strlist">input</append>
<append key="info.capabilities" type="strlist">input.mouse</append>
<merge key="input.x11_driver" type="string">vboxmouse</merge>
<merge key="input.device" type="string">/dev/vboxguest</merge>
</match>
</match>
</device>
</deviceinfo>
With all that set, it is time to ensure that the custom user account is added to the wheel and operator groups using this command:
pw user mod [user name] -G wheel operator
Executing the above as root means that the custom account can run the su
command so that logging in as root at the start of a desktop session no longer is needed. That is what being in the wheel group allows, so anyone in the operator group can shut down or restart the system. Since both are facilities readily available on Linux, so I fancied having them in FreeBSD too.
Being able to switch to root in a terminal session meant that I could go on to add software like Firefox, LibreOffice, GIMP, EMACS, Geany, NetBeans, Banshee and so on. Though there may be a line of opinion that FreeBSD is a server operating system, all of these make it more than passable for serving as a desktop one too. There may be no package management GUI as such and the ones that come with GNOME do not work either, yet anyone familiar with command line working will get around that.
While FreeBSD may be conservative, that has its place too, and being able to build up a system one item at a time teaches far more than getting everything already sorted in one hit. So far, there is enough documentation to get me going, leaving me to see where else things go too. So far, the OS hasn't been that intimidating, which is good to see.
The bold gamble behind Linux Voice magazine
1st March 2014During the latter part of last year, the magazine Linux Format suffered a staff clear-out, and I was left wondering why. It was as if a load of folk left at once and, even if I have seen that sort of thing happening at my current place of work, I was asking if something went wrong at Future Publishing. Instead, I had missed the fact that the former Linux Format staff were starting their own magazine. They crowdfunded it on Indiegogo. It took the appearance of Linux Voice on a shelf in the Macclesfield WHSmith's for me to become enlightened about this.
It seems risky for a whole team from one publisher's magazine to leave and create their own similar publication, especially given the current instability of magazine publishing in the digital age. The mention of a non-compete agreement reminded me of my own workplace. Their former employers' reaction would be interesting to know, as mine might consider legal action if I did something similar, assuming it were possible; I too would be bound by a six-month non-compete clause after leaving.
Regarding the magazine's content, it is appropriately good. While occasional misspellings might occur, articles on OwnCloud and Arch Linux installation, along with reviews of Mageia 4 and FreeBSD 10, would interest me. Many familiar names from Linux Format are also present, creating a sense of continuity. The new magazine's design is less extravagant than its established competitor, and their coexistence will be worth observing.
New ideas take time to develop, and I wish the new magazine success. Its goals are positive: half of its profits will support open-source software, and articles will be openly accessible via a Creative Commons licence. However, its immediate financial stability is crucial, making the next few months significant. The experienced team behind the magazine is a strong asset and could prevent it from becoming like Walking World Ireland and Cycling World, which appear irregularly in stores. The support of an enthusiastic community is also beneficial. I might eventually have to choose between Linux Voice and Linux Format, similar to my choice between Linux Magazine and Linux User & Developer. Despite being a niche operating system, Linux users have a good selection of magazines.
Setting up a WD My Book Live NAS on Ubuntu GNOME 13.10
1st December 2013The official line from Western Digital is this: they do not support the use of their My Book Live NAS drives with Linux or UNIX. However, what that means is that they only develop tools for accessing their products for Windows and maybe OS X. It still doesn't mean that you cannot access the drive's configuration settings by pointing your web browser at http://mybooklive.local/
. In fact, not having those extra tools is no drawback at all since the drive can be accessed through your file manager of choice under the Network section and the default name is MyBookLive too, so you easily can find the thing once it is connected to a router, or switch anyway.
Once you are in the server's web configuration area, you can do things like changing its name, updating its firmware, finding out what network has been assigned to it, creating and deleting file shares, password protecting file shares and other things. These are the kinds of things that come in handy if you are going to have a more permanent connection to the NAS from a PC that runs Linux. The steps that I describe have worked on Ubuntu 12.04 and 13.10 with the GNOME desktop environment.
What I was surprised to discover that you cannot just set up a symbolic link that points to a file share. Instead, it needs to be mounted and this can be done from the command line using mount or at start-up with /etc/fstab
. For this to happen, you need the Common Internet File System utilities and these are added as follows if you need them (check in the Software Centre or in Synaptic):
sudo apt-get install cifs-utils
Once these are added, you can add a line like the following to /etc/fstab
:
//[NAS IP address]/[file share name] /[file system mount point] cifs
credentials=[full file location]/.creds,
iocharset=utf8,
sec=ntlm,
gid=1000,
uid=1000,
file_mode=0775,
dir_mode=0775
0 0
Though I have broken it over several lines above, this is one unwrapped line in /etc/fstab
with all the fields in square brackets populated for your system and with no brackets around these. Though there are other ways to specify the server, using its IP address is what has given me the most success; this is found under Settings > Network on the web console. Next up is the actual file share name on the NAS; I have used a custom term instead of the default of Public. The NAS file share needs to be mounted to an actual directory in your file system like /media/nas
or whatever you like; however, you will need to create this beforehand. After that, you have to specify the file system, and it is cifs
instead of more conventional alternatives like ext4
or swap
. After this and before the final two space delimited zeroes in the line comes the chunk that deals with the security of the mount point.
What I have done in my case is to have a password-protected file share and the user ID and password have been placed in a file in my home area with only the owner having read and write permissions for it (600 in chmod
-speak). Preceding the filename with a "." also affords extra invisibility. That file then is populated with the user ID and password like the following. Of course, the bracketed values have to be replaced with what you have in your case.
username=[NAS file share user ID]
password=[NAS file share password]
With the credentials file created, its options have to be set. First, there is the character set of the file (usually UTF-8 and I got error code 79 when I mistyped this) and the security that is to be applied to the credentials (ntlm
in this case). To save having no write access to the mounted file share, the uid
and gid
for your user needs specification, with 1000 being the values for the first non-root user created on a Linux system. After that, it does no harm to set the file and directory permissions because they only can be set at mount time; using chmod
, chown
and chgrp
afterwards, has no effect whatsoever. Here, I have set permissions to read, write and execute for the owner and the user group while only allowing read and execute access for everyone else (that's 775 in the world of chmod
).
All of what I have described here worked for me and had to be gleaned from disparate sources like Mount Windows Shares Permanently from the Ubuntu Wiki, another blog entry regarding the permissions settings for a CIFS mount point and an Ubuntu forum posting on mounting CIFS with UTF-8 support. Because of the scattering of information, I just felt that it needed to all together in one place for others to use, and I hope that fulfils someone else's needs similarly to mine.
A way to get Rigo working again in Sabayon
23rd October 2013After having Sabayon running on a PC until it came to pieces after an attempted version upgrade, I went away from the Linux distro for a while and Linux Mint now runs on the aforementioned machine. It only was a certain curiosity that got me installing it into a virtual machine on VirtualBox to see if my command line method of keeping the system up to date was the cause or whether rolling or partially rolling distros have a certain fragility that is not seen in their discrete release counterparts.
Recently, that ran into a hitch, the Sabayon package manager Rigo failed to start up for me. After waiting to see if it sorted itself on its own, I looked into returning to those command line ways, and that line of enquiry led me to a method of restoring Rigo's functionality from Sabayon's wiki page on the underlying Entropy. The first step was to issue a command to become root:
su
That needed the appropriate password, and the next command issued updated Sabayon's repositories:
equo update
Once that had done its thing, it was time to install new versions of Entropy and Rigo:
equo install entropy rigo
With that complete, it was time to exit the root session with the exit command. Then, it was time to try running Rigo and it worked as expected. Any thoughts of adding in the superseded Sulfur (Rigo's predecessor) were banished on seeing that success.
Command Line Processing of EXIF Image Metadata
8th July 2013There is a bill making its way through the U.K. parliament at this time that could reduce the power of copyright when it comes to images placed on the web. The current situation is that anyone who creates an image automatically holds the copyright for it. However, the new legislation will remove that if it becomes law as it stands. As it happens, the Royal Photographic Society is doing what it can to avoid any changes to what we have now. Though there may be the barrier of due diligence, how many of us take steps to mark our own intellectual property? For one, I have been less that attentive to this and now wonder if there is anything more that I should be doing. While others may copyleft their images instead, I don't want to find myself unable to share my own photos because another party is claiming rights over them. There's watermarking as an object, yet I also want to add something to the image metadata too.
That got me wondering about adding metadata to any images that I post online that assert my status as the copyright holder. It may not be perfect, but any action is better than doing nothing at all. Given that I don't post photos where EXIF metadata is stripped as part of the uploading process, it should be there to see for anyone who bothers to check, and there may not be many who do.
Because I also wanted to batch process images, I looked for a command line tool to do the needful and found ExifTool. Being a Perl library, it is cross-platform so you can use it on Linux, Windows and even OS X. To install it on a Debian or Ubuntu-based Linux distro, just use the following command:
sudo apt-get install libimage-exiftool-perl
The form of the command that I found useful for adding the actual copyright information is below:
exiftool -p "-copyright=(c) John ..." -ext jpg -overwrite_original
The -p switch preserves the timestamp of the image file, while the -overwrite_original
one ensures that you don't end up with unwanted backup files. The copyright message goes within the quotes along with the -copyright
option. With a little shell scripting, you can traverse a directory structure and change the metadata for any image files contained in different sub-folders. If you wish to do more than this, there's always the user documentation to be consulted.
Turning on autocompletion for the bash shell in terminal sessions
26th June 2013At some point, I managed to lose the ability to have tab-key-based autocompletion on terminal sessions on my Ubuntu GNOME machine. Wanting it caused had me to turn to the web for an answer, and I found it on a Linux Mint forum; the bash shell is so pervasive in the UNIX and Linux worlds that you can look anywhere for a fix like this.
The problem centred around the .bashrc
file in my home area. It does have quite a few handy custom aliases, and I must have done a foolish spring-clean on the file sometime. That is the only way that I can explain how the following lines got removed:
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
What they do is look to see if /etc/bash_completion can be found on your system and to use it for tab-based autocompletion. With the lines not in .bashrc
, it couldn't happen. Others may replace bash_completion with bash.bashrc
to get a fuller complement of features, but I'll stick with what I have for now.
A little look at Debian 7.0
12th May 2013Having a virtual machine with Debian 6 on there, I was interested to hear that Debian 7.0 is out. In another VM, I decided to give it a go. Installing it on there using the Net Install CD image took a little while but proved fairly standard with my choice of the GUI-based option. GNOME was the desktop environment with which I went and all started up without any real fuss after the installation was complete; it even disconnected the CD image from the VM before rebooting, a common failing in many Linux operating installations that lands into the installation cycle again unless you kill the virtual machine.
Though the GNOME desktop looked familiar, a certain amount of conservatism reigned too, since the version was 3.4.2. That was no bad thing, since raiding the GNOME Extension site for a set of mature extensions was made easier. In fact, a certain number of these were included in the standard installation anyway and the omission of a power off entry on the user menu was corrected as a matter of course without needing any intervention from this user. Adding to what already was there made for a more friendly desktop experience in a short period of time.
Debian's variant of Firefox, IceWeasel, is version 10 so a bit of tweaking is needed to get the latest version. LibreOffice is there now too, and it's version 3.5 rather than 4. Shotwell too is the older 0.12 and not the 0.14 that is found in the likes of Ubuntu 13.04. As it happens, GIMP is about the only software with a current version and that is 2.8; a slower release cycle may be the cause of that, though. All in all, the general sense is that older versions of current software are being included for the sake of stability and that is sensible too, so I am not complaining very much about this at all.
The reason for not complaining is that the very reason for having a virtual machine with Debian 6 on there is to have Zinio and Dropbox available too. Adobe's curtailment of support for Linux means that any application needing Adobe Air may not work on a more current Linux distribution. That affects Zinio, so I'll be retaining a Debian 6 instance for a while yet, unless a bout of testing reveals that a move to the newer version is possible. As for Dropbox, I am sure that I can recall why I moved it onto Debian, but it's working well on there so I am in no hurry to move it over either. There are times when slower software development cycles are better...
Sorting a kernel upgrade error in Linux Mint 13
30th November 2012Linux Mint 14 may be out now, but I'll be sticking with its predecessor for now. Being a user of GNOME Shell instead of Cinnamon or Mate, I'll wait for extensions to get updated for 3.6 before making a move away from 3.4 where the ones that I use happily work. Given that Linux Mint 13 is set to get support until 2017, it's not as if there is any rush either. Adding the back-ported packages repository to my list of software sources means that I will not miss out on the latest versions of MDM, Cinnamon and Mate anyway. With Ubuntu set to stick to GNOME 3.6 until after 13.04 is released, adding the GNOME 3 Team PPA will be needed if 3.8 arrives with interesting goodies; there are interesting noises that suggest the approach taken in Linux Mint 12 may be used to give more of a GNOME 2 desktop experience. Options abound and there are developments in the pipeline that I hope to explore too.
However, there is one issue that I have had to fix which stymies upgrades within the 3.2 kernel branch. A configuration file (/etc/grub.d/10_linux
) points to /usr/share/grub/grub-mkconfig_lib
instead of /usr/lib/grub/grub-mkconfig_lib
so I have been amending it every time I needed to do a kernel update. However, it just reverts to the previous state, so I thought of another solution: creating a symbolic link in the incorrect location that points to the correct one so that updates complete without manual intervention every time. The command that does the needful is below:
sudo ln -s /usr/lib/grub/grub-mkconfig_lib /usr/share/grub/grub-mkconfig_lib
Of course, figuring out what causes the reversion would be good too, but the symbolic link fix works so well that there's little point in exploring it further. Of course, if anyone can add how you'd do that, I'd welcome this advice too. New knowledge is always good.
A place for GNOME?
21st September 2012There has been a lot of doom and gloom spoken about the GNOME desktop environment and the project behind it. These days, it seems to be the fashionable thing to go constantly criticising it, especially after what Linus Torvalds said. KDE went through the same sort of experience a few years ago and seems to have got far enough beyond it that some are choosing it instead of GNOME. For a good while, it was the other way around.
Since its inception, the GNOME Shell has attracted a lot of adverse comment. However, since my first encounter, it has grown on me to the point that I added it to Ubuntu and Linux Mint and use it as my default desktop environment instead of Unity, Mate or Cinnamon. The first of these may not be so surprising because of the unique approach that has been taken. The use of lenses and an application launch bar are items to which I could adapt, but it is the merging of application menus and title bars with the top panel of the desktop that really puts me off it. Application window buttons can be moved to the right everywhere but on this global menu, so I tend to view things from afar instead of using it every day. There just is something about the experience that won't grow on me. Strangely, that also applies to my impressions of KDE, albeit differently; there just is something less slick about the appearance of the bottom panel, the plasmoids and other items like them.
Given that Mate and Cinnamon continue the GNOME 2 approach to things that dominated my home computing for much of the last five years since I turned to Ubuntu, my decision to use GNOME Shell instead of either come as a surprise. It isn't that the environments aren't slick enough, just that I have come to prefer the way that GNOME Shell handles workspaces, spawning them as you need them. If that could be an option in Cinnamon, then it might become my desktop of choice. However, that seems to go against the philosophy of the project, even if someone adds and extension for it.
For a time, I played with going with LXDE rather than either Unity or GNOME Shell; as it happened, my first impressions of the latter weren't so positive until I spent a day with the GNOME variant of Fedora 15. Being not dissimilar to GNOME 2 in the way that it worked was the main attraction of LXDE and my initial use of it was with Lubuntu running on a netbook; the LXDE version of Linux Mint 12 now runs on it so there hasn't been so much change on that machine.
Sometimes, the only way to deal with change is to have a look at it to see what's coming and to decide what you need to do about it. In the case of GNOME Shell, my day with Fedora 15 on a backup PC changed my impressions, and Linux Mint 11's GNOME 2 desktop looked a bit old-fashioned afterwards. In fact, I popped GNOME 3 on there and have been using it as my main desktop environment ever since.
With computing, there always are some who expect things to just work and be the way that they want them. The need for extra configuration is a criticism that still can be levelled at GNOME Shell. Before going with Mate and Cinnamon, Linux Mint went the same way for a while, leaving me to wonder what can be done with such an approach. Will someone else pick up that baton and do the handiwork so that users don't have to do it? Not yet, it seems. Since no one is following the lead of Linux Mint 12, the need for user tweaking remains, even if I have found which ones work for me.
The first place to begin is GNOME's Extensions website, from where I raid a few extensions every time I do an operating system installation. The Alternative Status Menu extension is among the first to get added so that I have the shutdown option again on the user menu, a common criticism of the default set up. Since I always install the GNOME Tweak Tool from the distro repositories, I add the Advanced Setting in User Menu extension to get an entry in the status menu that grants quick access. Frippery Bottom Panel comes next on the list because of its workspace switcher and application window list. Others like Frippery Move Clock, Monitor Status Indicator, Places Status Indicator, Removable Drive Menu, Remove Accessibility, Shell Restart User Menu Entry and User Themes follow in some order and make things feel more pleasing, at least to my mind.
You aren't stuck with the default theme, either, and I have chosen Elementary Luna from deviantART. For adding your own themes, the above listed User Themes extension is needed. Because I want the Frippery Bottom Panel to match the top panel, I tweaked its stylesheet and that's where the Restart User Menu Entry extension comes in handy, though some care is needed not to crash the desktop with constant shell restarts.
Doing the above makes GNOME Shell really amenable to me, and I wouldn't like to lose that freedom to customise. Saying that, the continued controversial changes aren't stopping yet. Those made to the Nautilus file manager in GNOME 3.6 have caused the Linux Mint project to create Nemo, a fork of the software, and Ubuntu is sticking with the previous version for now. Taking some action yourself instead of just complaining loudly sounds like a more positive approach, which makes its own statement. However, at a time when many want the GNOME project team to listen to users, the new Nautilus appears and is not to be what they needed to see. Could the project go on like this? Only time can answer that one.
While it appears that many have changed from GNOME to other desktop environments, I haven't come across any numbers. A reducing user base could be a way of sending a message about any discontent, one that makes use of a great feature of free software: there is plenty of choice. If the next version of Nautilus isn't to my taste, there are plenty of alternatives out there. After all, Cinnamon started on Linux Mint and has gone from there to being available for other distros too; Fedora is one example. Nemo could follow suit.
Now that GNOME's constituent applications are seeing changes, GNOME Shell may be left to mature. Computer interfaces are undergoing a lot of change at the moment and Microsoft Windows 8 is bringing its own big leap. Though controversial at the time, change can be a good thing too and us technical folk always like seeing new things come along (today saw the launch of the iPhone 5 and many folk queueing up for it; Google's Nexus 7 ran out of stock in its first weeks on the market; there are more). That could be what got me using GNOME 3 in the first place, even if my plan is to stick with it for a while yet.
Removing VMware Player from Linux Mint Debian Edition
4th August 2012A whole slew of updates has appeared for my Linux Mint Debian Edition PC. However, to instate them, I needed to remove VMware Player and this is the command to do so:
sudo vmware-installer -u vmware-player
It worked in my case, and my system updates are in progress as I write this. The same command should work for other Linux distros where VMware Player was installed using the *.bundle
installer. VMware Player remains in place on my main PC though, so I am not ditching it just yet, even if I have to be careful when running it on Linux Mint 13 so as not to freeze the system on myself.