TOPIC: OPERATING SYSTEMS
Uninstalling VirtualBox Guest Additions on a Linux Guest OS
8th April 2012Within the last few days, I updated my Linux Mint Debian Edition virtual machine installation to Update 4. Between not following the instructions so closely and problems with the update server, a re-installation preceded the update itself. When all was done, no desktop environment appeared, and issuing the startx
command revealed that it was one of the VirtualBox drivers that was the cause of the problem. With my being unable to see any files on the VirtualBox virtual CD, something else needed doing and the executing following command (replacing [VboxAddonsFolder]
with VBoxGuestAdditions-4.1.12
in my case, but it is different for each VirtualBox version) resolved the situation:
/opt/[VboxAddonsFolder]/uninstall.sh
When it was complete, a scrambled desktop began to appear, so a reboot was to set things to rights. Then, I could set to looking at what Update 4 had brought to Linux Mint Debian Edition.
Getting Gnome Shell going for Fedora 16 running in VirtualBox
5th December 2011There are a number of complaints out there about how hard it is to get GNOME Shell running for a Fedora 16 installation in a VirtualBox virtual machine. As with earlier versions of Fedora, preparation remains a matter of having make
, gcc
and kernel-devel
(kernel headers, in other words). While I have got away with just those, adding dkms
(dynamic kernel module support) to the list might be no bad idea either. To get all of those instated, it is a matter of running the following command as root or using sudo
:
yum -y install make gcc kernel-devel dkms
The -y
switch ensures that any Y/N prompts that usually appear are suppressed and that the installation is completed. Just leave it out if you are inclined to get second thoughts. Another item that has been needed with a previous release of Fedora is libgomp
, but I haven't had to add this for Fedora 16 if I recall correctly.
Once those are in place, it is time to install the VirtualBox Guest Additions. Going to Devices > Install Guest Additions... mounts a virtual CD that can be used for the installation of the various drivers that are needed. To do the installation, first go to where the installer is located using the following command:
cd /media/VBOXADDITIONS_4.1.6_74713/
Note that this location will change according to the release and build numbers of VirtualBox, yet the process essentially will be the same aside from this. Once in there, issue the following command as root or using sudo:
./VBoxLinuxAdditions.run
Hopefully, this will complete without errors now with the precursor software that has been added beforehand. However, there is one more thing that needs doing, or you will get the GNOME 3 fallback desktop instead. It pertains to SELinux, an old adversary of mine that got in the way when I was setting up a web server on a machine running Fedora. It doesn't recognise the new VirtualBox drivers as it should, so the following command needs executing as root or using sudo
:
restorecon -R -v /opt
Doing this restores the SELinux contexts for the /opt
directories within which the VirtualBox software directories are found. The -R
switch tells it to act recursively and -v
makes it verbose. When it has done its work, hopefully successfully, it is time to reboot the virtual machine, and you should have a GNOME Shell desktop interface when you log in.
Sorting out MySQL on Arch Linux
5th November 2011Seeing Arch Linux running so solidly in a VirtualBox virtual box has me contemplating whether I should have it installed on a real PC. Saying that, recent announcements regarding the implementation of GNOME 3 in Linux Mint have caught my interest, even if the idea of using a rolling distribution as my main home operating system still has a lot of appeal for me. Having an upheaval come my way every six months when a new version of Linux Mint is released is the main cause of that.
While remaining undecided, I continue to evaluate the idea of Arch Linux acting as my main OS for day-to-day home computing. Towards that end, I have set up a working web server instance on there using the usual combination of Apache, Perl, PHP and MySQL. Of these, it was MySQL that went the least smoothly of all because the daemon wouldn't start for me.
It was then that I started to turn to Google for inspiration, and a range of actions resulted that combined to give the result that I wanted. One problem was a lack of disk space caused by months of software upgrades. Since tools like it in other Linux distros allow you to clear some disk space of obsolete installation files, I decided to see if it was possible to do the same with pacman, the Arch Linux command line package manager. The following command, executed as root, cleared about 2 GB of cruft for me:
pacman -Sc
The S in the switch tells pacman to perform package database synchronization, while the c instructs it to clear its cache of obsolete packages. In fact, using the following command as root every time an update is performed both updates software and removes redundant or outmoded packages:
pacman -Syuc
So I don't forget the needful housekeeping, this will be what I use from this point forward, with y
being the switch for a refresh and u
triggering a system upgrade. It's nice to have everything happen together without too much effort.
To do the required debugging that led me to the above along with other things, I issued the following command:
mysqld_safe --datadir=/var/lib/mysql/ &
This starts up the MySQL daemon in safe mode if all is working properly, and it wasn't in my case. Nevertheless, it creates a useful log file called myhost.err
in /var/lib/mysql/
. This gave me the messages that allowed the debugging of what was happening. It led me to installing net-tools
and inettools
using pacman; it was the latter of these that put hostname on my system and got the MySQL server startup a little further along. Other actions included unlocking the ibdata1 data file and removing the ib_logfile0
and ib_logfile1
files to gain something of a clean sheet. The kill command was used to shut down any lingering mysqld
sessions too. To ensure that the ibdata1 file was unlocked, I executed the following commands:
mv ibdata1 ibdata1.bad
cp -a ibdata1.bad ibdata1
These renamed the original and then crafted a new duplicate of it, with the -a
switch on the cp
command forcing copying with greater integrity than normal. Along with the various file operations, I also created a link to my.cnf
, the MySQL configuration file on Linux systems, in /etc using the following command executed by root:
ln -s /etc/mysql/ my.cnf /etc/my.cnf
While I am unsure if this made a real difference, uncommenting the lines in the same file that pertained to InnoDB tables. What directed me to these were complaints from mysqld_safe in the myhost.err
log file. All I did was to uncomment the lines beginning with innodb
and these were 116-118, 121-122 and 124-127 in my configuration file, but it may be different in yours.
After all the above, the MySQL daemon ran happily and, more importantly, started when I rebooted the virtual machine. Thinking about it now, I believe that it was a lack of disk space, the locking of a data file and the lack of InnoDB support that was stopping the MySQL service from running. Running commands like mysqld
start weren't yielding useful messages, so a lot of digging was needed to get the result that I needed. In fact, that's one of the reasons why I am sharing my experiences here.
In the end, creating databases and loading them with data were all that was needed for me to start to see functioning websites on my (virtual) Arch Linux system. It turned out to be another step on the way to making it workable as a potential replacement for the Linux distributions that I use most often (Linux Mint, Fedora and Ubuntu).
Ridding Fedora of Unwanted Software Repositories
4th November 2010Like other Linux distributions, Fedora has the software repository scheme of things for software installation and updating. However, it could do with having the ability to remove unwanted repositories through a GUI, only it doesn't. What you need to do instead is switch to root in a terminal using the command su -
and enter your root user password before navigating to /etc/yum.repos.d/
to delete the troublesome [file name].repo file. Recently, I needed to do this after upgrading to Fedora 14 or yum
wouldn't work from the command line, which is the way that I tend to update Fedora (yum -y update
is the command that I use because it automatically does all installations unattended until it is finished doing what's needed). The offending repository, or "Software Source" as these things are called in the GUI, belonged to Dropbox and even disabling it didn't make yum
operate from the command like it should, so it had to go. Maybe Dropbox hasn't caught up with the latest release of Fedora, but that can be resolved another day.
Taking the sudo command beyond Ubuntu
27th October 2010Though some may call it introducing a security risk, being able to execute administrator commands on Ubuntu using sudo and gksu by default is handy. It's not the only Linux distribution with the facility, though, since the /etc/sudoers
file is found in Debian and I plan to have a look into Fedora. The thing that needs to be done is to add the following line to the aforementioned file (you will need to do this as root):
[your user name] ALL=(ALL) ALL
One that is done, you are all set. Just make sure that you're using a secure password, though, and removing the sudo/gksu permissions is as simple as reversing the change.
Update on 2011-12-03: The very same can be done for both Arch Linux and Fedora, The same file locations apply too.
Relocating the Apache web server document root directory in Fedora 12
9th April 2010So as not to deface anything that is available online on the web, I have a tendency to set up an offline Apache server on a home PC to do any tinkering away from the eyes of the unsuspecting public. Though Ubuntu is my mainstay for home computing, I do have a PC with Fedora installed, and I have been trying to get an Apache instance to start automatically on there unsuccessfully for a few months. While I can start it by running the following command as root, I'd rather not have more manual steps than is necessary.
httpd -k start
The command used by the system when it starts is different and, even when manually run as root, it failed with messages saying that it couldn't find the directory while the web server files are stored. Here it is:
service httpd start
The default document root location on any Linux distribution that I have seen is /var/www
and all is very well with this, but it isn't a safe place to leave things if ever a re-installation is needed. Having needed to wipe /var after having it on a separate disk or partition for the sake of one installation, it doesn't look so persistent to me. In contrast, you can safeguard /home
by having it on another disk or in a dedicated partition, which means that it can be retained even when you change the distro that you're using. Thus, I have got into the habit of having the root of the web server document root folder in my home area, and that is where I have been seeing the problem.
Because of the access message, I tried using chmod
and chgrp
, but to no avail. The remedy has to do with reassigning the security contexts used by SELinux. In Fedora, Apache will not work with the context user_home_t
that is usually associated with home directories, but needs httpd_sys_content_t
instead. To find out what contexts are associated with particular folders, issue the following command:
ls -Z
The final solution was to create a user account whose home directory hosts the root of the web server file system, called www
in my case. Then, I executed the following command as root to get things going:
chcon -R -h -t httpd_sys_content_t /home/www
It appears that even the root of the home directory has to have an appropriate security context (/home
has home_root_t
so that might do the needful too). Without that, nothing will work, even if all is well at the next level down. The switches for chcon
command translate as follows:
-R
: recursive; applies changes to all files and folders within a directory.
-h
: changes apply only to symbolic links and not to where they refer in the file system.
-t
: alters context type.
It took a while for all of this stuff about SELinux security contexts to percolate through to the point where I was able to solve the problem. A spot of further inspiration was needed too and even guided my search for the information that I needed. It's well worth trying Linux Home Networking if you need further details. Though there are references to an earlier release of Fedora, the content still applies to later versions of Fedora to the current release, if my experience is typical.
Getting Fedora working in VirtualBox
12th May 2009After a hiatus induced by disk errors seen on start up, I have gone having a go with Fedora again. In the world of real PC's, its place has been taken by Debian, so virtualisation was brought into play for my most recent explorations. I could have gone with 10, the current stable version, but curiosity got the better of me and I downloaded a pre-release version of 11 instead.
On my way to getting that instated, I encountered two issues. The first of these was boot failure with the message like this:
FATAL: INT18: BOOT FAILURE
As it turned out, that was easily sorted. I was performing the installation from a DVD image mounted as if it were a real DVD, and laziness or some other similar reason had me rebooting with it still mounted. Though there is an option to load the hard disk variant, it wasn't happening, resulting in the message that's above. A complete shutdown and replacement of the virtual DVD with a real one set matters to rights.
The next trick was to get Guest Additions added, but Fedora's 2.6.29 was not what VirtualBox was expecting, and it demanded the same ransom as Debian: gcc
, make and kernel header files. Unfamiliarity had me firing up Fedora's software installation software, only to find that Synaptic seems to beat it hands down in the search department. Turning to Google dredged up the following command to be executed, which got me further:
yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel
However, the installed kernel headers didn't match the kernel, but a reboot fixed that once the kernel was updated. Then, the Guest Additions installed themselves as intended, with necessary compilations to match the installed kernel.
The procedures that I have described here would, it seems, work for Fedora 10; well, they certainly have bequeathed me a working system. I have had a little poke and a beta of Firefox 3.5 is included, and I saw sign of OpenOffice 3.1 too. So, it looks very cutting edge, easily so in comparison with Ubuntu and Debian. Apart from one or niggles, it seems to run smoothly too. Firstly, don't use the command shutdown -h now to close the thing down, or you'll cause VirtualBox to choke. Using the usual means ensures that all goes well, though. The other irritation is that it doesn't connect to the network without a poke from me. Whether SELinux is to blame for this or not, I cannot tell, but it might be something for consideration by the powers than be. That these are the sorts of things that I have noticed should be telling you that I have no major cause for complaint. While I have mulled over a move to Fedora in the past and that option remains as strong as ever, Ubuntu is not forcing me to look at an alternative and the fact that I know how to achieve what I need is resulting in inertia anyway.
On keyboards
17th April 2009While there cannot be too many Linux users who go out and partner a Microsoft keyboard with their system, my recent cable-induced mishap has resulted in exactly that outcome. Keyboards are such standard items that it is not so possible to generate any excitement about them, apart from RSI-related concerns. While I wasn't about to go for something cheap and nasty that would do me an injury, going for something too elaborate wasn't part of the plan either, even if examples of that ilk from Microsoft and Logitech were sorely tempting.
Shopping in a bricks and mortar store, like I was, has its pluses and its minuses. The main plus points are that you see and feel what you are buying, with the main drawback being that the selection on offer isn't likely to be as extensive as you'd find on the web, even if I was in a superstore. Despite the latter, there was still a good deal available. Though there were PS/2 keyboards for anyone needing them, USB ones seemed to be the main offer, with wireless examples showcased too. Strangely, the latter were only available as kits with mice included, further adding to the cost of an already none too cheap item. The result was that I wasn't lured away from the wired option.
While I didn't emerge with what would have been my first choice because that was out of stock, that's not to say that what I have doesn't do the job for me. The key action is soft and cushioned, which is a change from that to which I am accustomed; some keyboards feel like they belong on a laptop, but not this one. There are other bells and whistles too, with a surprising number of them working. The calculator and email buttons number among these along with the play/pause, back and forward ones for a media player; I am not so convinced about the volume controls though an on-screen indicator does pop up. You'd expect a Microsoft item to be more Windows specific than others, yet mine works as well as anything else in the Ubuntu world and I have no reason to suspect that other Linux distros would spurn it either. Keyboards tend to be one of those "buy-it-and-forget-it" items, and the new arrival should be no different.
Some things that I'd miss on moving from Linux to Windows
17th January 2009The latest buzz surrounding Windows 7 has caused one observer to suggest that it's about to blast Linux from the desktop. While my experiences might be positive, there are still things that I like about Linux that make me reluctant to consider switching back. Here are a few in no particular order:
Virtual Desktops (or Workspaces)
I find these very handy for keeping things organised when I have a few applications open at the same time. While I think that someone has come with a way of adding the same functionality to Windows, I'd need to go looking for that. Having everything cluttering up a single taskbar would feel a bit limiting.
Symbolic Links
If you have not come across these before, they are a little difficult to explain, but it's great to have the ability to make the contents of a folder appear in more than one place at a time without filling up your hard drive. While it's true to say that Windows 7 gets Libraries, I have a soft spot for the way that Linux does it so simply.
Lack of (intrusive) fidgeting
One of Windows' biggest problems is that it's such a massive target for attacks by the less desirable elements of the web community. The result is a multitude of security software vendors wanting to get their wares onto your PC; it's when they get there that all the fidgeting starts. The cause is the constant need for system monitoring that eats up resources that could be used for other things. Though I know some packages are less intrusive than others, I do like the idea of feeling as if I am in full control of my PC rather someone else taking decisions for me (unavoidable in the world of work, I know). An example of this is Norton's not allowing me to shut it down when it goes rogue, even when acting as Administrator. While I can see the reason for this in that it's trying to hamper the attentions of nefarious malware, it ends up making me feel less than empowered and I also like to feel trusted too. Another thing that I like is the idea of something awaiting my input rather than going away and trying to guess what I need and getting it wrong, an experience that seems typical of Microsoft software.
Command Line
Though this is less of a miss than it used to be, there is now a learning curve with PowerShell's inclusion with Windows 7, and it's not something that I want to foist on myself without my having the time to learn its ins and outs. Though it's not a bad skill to have listed on the proverbial CV, I now know my way around bash and its ilk while knowing where to look when I intend to take things further.
After these, there are other personal reasons for my sticking with Linux, like memories of bad experiences with Windows XP and the way that Linux just seems to get on with the job. Its being free of charge is another bonus, and the freedom to have things as you want makes you feel that you have a safer haven in this ever-changing digital world. While I am not sure if I'd acquire the final version of Windows 7, I am certain that it will not be replacing Linux as my main home computing platform, something that should come as no surprise given what I have said above.
Copying only updated and new files
20th October 2008With Linux/UNIX, the command line remains ever useful and allows you to do all manner of things, including file copying that only adds new files to a destination. Here's a command that accomplishes this on Linux:
cp -urv [source] [destination]
The u
switch does the update while r
ensures recursion (by default, cp
only copies files from a source directory and not anything sitting in subfolders) and v
tells the command to tell the user what is happening.
Though buried and hardly promoted, Windows also has its command line and here's what accomplishes a similar result:
xcopy /d /u [source] [destination]
Anything's better than having to approve or reject every instance where source and destination files are the same or, even worse, to overwrite a file when it is not wanted.