Showing posts with label Fedora. Show all posts
Showing posts with label Fedora. Show all posts

Thursday, November 5, 2015

VMWare Shared Folders oin Fedora 23


Hi,

if you haven't noticed: Fedora 23 is out, and its time to get your hands wet on it. Being forced to use a Windows Laptop, I am typically doing this by installing a VMware guest. Once the virtual machine is up, the first thing i want to do is accessing my Windows home directory. The easiest way to do this is by creating a so-called "Shared Folder" in the VMware settings for my machine. On the guest, you need to install the "VMware Tools" and do something like

mkdir /home/username/sharedfolder
sudo mount -t vmhgfs -o uid=1000,gid=1000 .host:sharename /home/username/sharedfolder

(The options uid=1000,gid=1000 ensure, that the mounted directory is readable, and writable for the user with uid=1000, and gid=1000, which is me.)

The problem with that procedure is, that it depends on a kernel module called "hgfs", which must be installed as part of the "VMware Tools". And, needless to say: Installation of the VMware Tools (version 9.2.0-799703, as of this writing) fails, because the Kernel isn't compatible to the sources distributed by VMware.

So far, the only reasonable solution was to wait for an updated tools version by VMware. (I generally ignored the possibility to patch those distributed sources as overly complicated, and insecure. However, there's a new, and better solution available:

Fedora 23 automatically installs an RPM named open-vm-tools. And this includes two programs, that allow use of shared folders without the kernel module:

  # Display a list of all shared folders:
  # Note, that it includes a share called "sharedfolder".
  $ vmware-hgfsclient sharedfolder

  # Create a directory named /home/username/foo, and mount the shared folder there.
  $ vmhgfs-fuse .host:foo /home/username/sharedfolder
  $ cd /home/username/sharedfolder
  $ touch testfile
  $ rm testfile

Note, that neither "sudo" nor the specification of any options was required.

So, in other words: As of Fedora 23, the VMware Tools are no longer required. Mouse integration, Cut and Paste, and using shared folders: Everything works out of the box. (I can live without the thin print drivers.)




Tuesday, September 10, 2013

Installing Obsolete Java JDK versions on Fedora Linux

As a Java developer, one is frequently forced to use obsolete, or even deprecated, Java versions. So I came to the necessity to install Java 6 on Fedota 19. The problem: In the Fedora 19 repositories, there's only Java 7 and 8. Convince yourself:

$ sudo yum list | grep openjdk
java-1.6.0-openjdk.x86_64              1:1.6.0.0-59.1.10.3.fc16         installed
java-1.6.0-openjdk-devel.x86_64        1:1.6.0.0-59.1.10.3.fc16         installed
java-1.6.0-openjdk-javadoc.x86_64      1:1.6.0.0-59.1.10.3.fc16         installed
java-1.7.0-openjdk.x86_64              1:1.7.0.60-2.4.2.0.fc19          @updates
java-1.7.0-openjdk-demo.x86_64         1:1.7.0.60-2.4.2.0.fc19          @updates
java-1.7.0-openjdk-devel.x86_64        1:1.7.0.60-2.4.2.0.fc19          @updates
java-1.7.0-openjdk-javadoc.noarch      1:1.7.0.60-2.4.2.0.fc19          @updates
java-1.7.0-openjdk-src.x86_64          1:1.7.0.60-2.4.2.0.fc19          @updates
java-1.7.0-openjdk-accessibility.x86_64
java-1.8.0-openjdk.i686                1:1.8.0.0-0.9.b89.fc19           updates 
java-1.8.0-openjdk.x86_64              1:1.8.0.0-0.9.b89.fc19           updates 
java-1.8.0-openjdk-demo.x86_64         1:1.8.0.0-0.9.b89.fc19           updates 
java-1.8.0-openjdk-devel.i686          1:1.8.0.0-0.9.b89.fc19           updates 
java-1.8.0-openjdk-devel.x86_64        1:1.8.0.0-0.9.b89.fc19           updates 
java-1.8.0-openjdk-javadoc.noarch      1:1.8.0.0-0.9.b89.fc19           updates 
java-1.8.0-openjdk-src.x86_64          1:1.8.0.0-0.9.b89.fc19           updates 
The same goes for Fedora 18 and 17, btw. (I'll skip the output here. Note, that processing these commands will take some time, as yum will download the complete repository metadata for the respective version.
$ sudo yum --releasever=17 list | grep openjdk
$ sudo yum --releasever=18 list | grep openjdk
However, Java 6 is available for Fedora 16!
$ export http_proxy=MY_PROXY_URL, for example http://my.proxy.server:8080
$ wget wget http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/16/Fedora/x86_64/os/Packages/java-1.6.0-openjdk-1.6.0.0-59.1.10.3.fc16.x86_64.rpm
$ wget http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/16/Fedora/x86_64/os/Packages/java-1.6.0-openjdk-devel-1.6.0.0-59.1.10.3.fc16.x86_64.rpm
$ wget http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/16/Fedora/x86_64/os/Packages/java-1.6.0-openjdk-javadoc-1.6.0.0-59.1.10.3.fc16.x86_64.rpm
Now, my first (and preferred) attempt to install these would be
$ sudo yum localinstall --obsoletes java-1.6.0-openjdk*
which fails, due to the following error message:
  error: Failed dependencies:
  java-1.6.0-openjdk is obsoleted by (installed) java-1.7.0-openjdk-1:1.7.0.60-2.4.2.0.fc19.x86_64
  java-1.6.0-openjdk-devel is obsoleted by (installed) java-1.7.0-openjdk-1:1.7.0.60-2.4.2.0.fc19.x86_64
  java-1.6.0-openjdk-javadoc is obsoleted by (installed) java-1.7.0-openjdk-1:1.7.0.60-2.4.2.0.fc19.x86_64
(Please contact me, if you have an idea on how to get rid of these!) Fortunately, there's another possibility, which does the job quite neatly:
$ sudo rpm --nodeps -i java-1.6.0-openjdk*
If you're an Eclipse user, the JDK can now be found in /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/

Saturday, August 8, 2009

Fedora - the name

I am a Fedora Linux (initially Fedora Core Linux) user since version 1. Ever since, I wondered about the name Fedora from time to time. Sounded much like a russian princess. Didn't seem to fit, though.

Today, I was looking for a birthday present to my father. Unlike me, he's an avid walker. So I though, a hat might be a good idea. (He used to wear one in the past.) And while searching, I stumbled about this entry in Wikipedia: A Fedora is a hat! And, if you look at the picture, it very much resembles the famous Red Hat!

A name well choosen.

Thursday, June 18, 2009

The new kid on the virtualization block

Last week, I happily upgraded my Linux installation to Fedora 11. As usual, this wasn't driven by any requirements, just by the fun to have the latest and greatest. (Do I hear Anjas "MEN!" :-) On the whole, things have improved. For example, my UMTS stick is now working out of the box. Monitor switching at work is now working nicely.

An obvious minus, however, is the integration of VMware. I am using VMware server 1, which is almost unsupported on Fedora in general. In particular, it it unsupported for Fedora 11. As usual, it was no problem to find a matching kernel patch. But, what a surprise, it is no longer sufficient to patch the VMware modules: You need to patch the kernel as well. Ok, I detected the procedure within one hour. But that means, that I will have to compile my own kernel with any kernel upgrade. Given the frequency of kernel updates on Fedora, I'll likely recompile every two weeks or so.

Brings up the question for alternatives. I have tried VMware server 2 in the past, but was definitely disappointed, because it is both a resource hog (for example, more than 400MB on disk!) and the lack of the former vmware-console just adds on. Nevertheless, I tried again. Just to detect that the same problem seems to be present: The kernel modules fail to load with the same error message of a missing symbol.

I never tried VirtualBox before, but this seemed to be a good enough reason to do it now. First impressions have been quite positive, until I tried to start a VM with a windows guest system. Obviously, that's not so easy: To get it work, you have to change some settings, fiddle with the windows registry (of course, before starting Windows ...) and similar niceties. Again, that's not what I'd like to have as a standard procedure. VM's should be easily adoptable from or given to colleagues.

So far, I was sticking to VMware server 1. But today, I detected the announcement of VirtualBox 3 beta. And, hard to believe, it just works, even with Windows guests imported from VMware. I think, VMware lost a user...

Monday, June 8, 2009

Automatically compiling VMWare modules

VMWare does, in general, an excellent job. It runs smoothless on my machine, generally being one of my best work horses. In particular, with VMWare Server coming at no cost.

There's an exception, though: The kernel modules. As usual, the problem doesn't exist on a Windows host (or guest, for that matter), but you've got to know how to deal with it on a Linux host. VMWare depends on a number of kernel modules, for example vmnet.o, which creates the virtual network interfaces. In theory, these modules are delivered as part of the VMWare distribution for a variety of Linux distributions. In practice, I am unaware of any example, where these precompiled modules could been used: I always needed to compile them for myself.

Ok, that's not too much trouble (at least not, if you've been able to obtain the right patch for your system, typically after a lot of Googling), basically all you need to do is to run vmware-config.pl (on the host) or vmware-config-tools.pl. However, one problem is still left: The procedure of recompiling the modules needs to happen after any Kernel upgrade again.

But here's a solution: An init-script, which is invoked before VMWare starts upon every reboot. The script checks, whether there are modules matching the running kernel. If not, vmware-config.pl is invoked with the necessary options for batch mode.

To install it, download the script here. Store it as /etc/init.d/vmware-kernel-modules. On Fedora-Linux, create the necessary links by running /sbin/chkconfig --add vmware-kernel-modules. On other distributions, this must be done manually.

Monday, May 11, 2009

Mobile Internet with Fedora 10 and Simply (T-Mobile)

I think, any experienced Linux user knows that feeling: Even while you generally feel fine with your OS, there are these moments when you ask yourself whether you should switch to Windows. Typically, these moments come whenever you've got some new hardware gadget.

In my case, this has been a so-called web'n'walk Stick from Germany's T-Mobile, which I intend to use for connecting to the Internet on travel. Unfortunately, I am quite frequently on the road, or visiting customers, where I cannot connect my Laptop to the network, so this thing will come in quite handy.

Would I be a Windows user (or perhaps a Mac fanatic), this wouldn't be worth posting: Of course, the device is neatly trimmed for Windows, making almost everything automatic. Basically, you plug it in, enter your PIN, and that's it. Not so with Linux, or (to be fair), at least not with Fedora Linux. I've got it running now (in fact, this post is written with the Ethernet disconnected), but that's after several hours of recherche, postings in mailing lists and in the Fedora Forum (not that these had any results). As usual, you need to understand what's going on, making yourself known to technical concepts, command line utilities and configuration files, which you never intended to know. And that's the reason for writing this: Perhaps I can save some other persons time.

The first thing to understand is this: In order to make life easier for Windows and Mac users, the device is running in one of two quite different operation modes. The first mode is the default mode: The stick acts as a very small USB drive. On Windows, this allows to automatically install software from it. Needless to say, there are no Linux drivers. (The good news: All drivers came as part of Fedora. :-) Also needless to say: This default mode is not what you want. You must deactivate it and switch to the other mode, where you can actually use the stick. (I assume that the installed software does that automatically on Windows.)

There are several tools and utilities for doing this switch: usb_modeswitch (which I choosed, because it comes with Fedora), rezero, ozerocdoff, and perhaps a multitude of others. (My guess is, it would help, if distributions could agree on a common choice here.) These tools typically need some configuration. To obtain this configuration, start looking at the output of


[jwi@mcjwi ~]$ /sbin/lsusb
Bus 001 Device 005: ID 413c:8103 Dell Computer Corp. Wireless 350 Bluetooth
Bus 001 Device 006: ID 0b97:7762 O2 Micro, Inc. Oz776 SmartCard Reader
Bus 001 Device 004: ID 0b97:7761 O2 Micro, Inc. Oz776 1.1 Hub
Bus 001 Device 002: ID 413c:a005 Dell Computer Corp. Internal 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 004: ID 0af0:6971 Option
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

If you don't know, which line belongs to your stick: Just remove it, run the program again, and see what changes. In my case, the interesting part is

  Bus 003 Device 004: ID 0af0:6971 Option

The ID consists of two parts: The so-called vendor ID (0af0) and the product ID (6971).

If you have usb_modeswitch, you might inspect a file called usb_modeswitch.conf (in my case /etc/usb_modeswitch.conf) and search for the above ID's. There's a good chance that you find them there. If not, enter them into Google, together with usb_modeswitch as an additional search term. Again, there's a good chance to find something. If not: Bad luck. I don't know what to do in that case, but I guess consulting the above tools mailing lists, forums, or whatever.

In my case, I've learned from the configuration file and some Internet pages that I've got to enter the command


sudo usb_modeswitch -v 0af0 -p 6971 -P 6971 -m 0x05 -M 55534243785634120100000080000601000000000000000000000000000000

to change the mode. First step done. If everything's fine, the following command should now provide some meaningful output:

  [jwi@mcjwi ~]$ hal-find-by-capability --capability=modem
/org/freedesktop/Hal/devices/usb_device_af0_6971_Serial_Number_if0_serial_unknown_1
/org/freedesktop/Hal/devices/usb_device_af0_6971_Serial_Number_if0_serial_unknown_0

Now enter NetworkManager (aka nm-connection-editor) and switch to "Mobile Broadband". Press "Add" to create a new connection. If you're lucky, you will find a popup like the following:


The second and third entry are default entries. The presence of the first entry shows you that NetworkManager recognized your stick. Needless to say: In my case, it didn't. After consulting the home page of usb_modeswitch I found out, that I need to load some other driver explicitly:

/sbin/modprobe option

In your case, this might be usbserial, rather than option. Sorry, can't help you here.

But if you can choose your "modem": Almost there! (Not yet, of course.) NetworkManager will open a window like the following:



(In the US, or to be precise, with CDMA this might look quite different.) The PIN and the PUK are what you get from your mobile broadband provider. If you're even luckier, the provider will tell you the other data as well, in the written data sheet, or at least on the hotline. Perhaps, you already guessed it: My provider didn't. ("We aren't supporting Linux.")

To find the remaining data, use Google again. In my case, the relevant search terms have been "T-Mobile APN PIN". (Simply is a reseller of T-Mobile) Another choice might be to consult the list of operators on the Gnome site. I've found the following entry there:

        
147
T-mobile
de
D1
internet.t-d1.de
t-d1

193.254.160.1
193.254.160.130



Tells me the APN (might be some servers host name?), and the password. (You should be able to ignore the DNS servers, as they are configured automatically.) In my case the user name was missing, but some more googling revealed the user name "Internet".

Believe it or not, but now it's working! (Might be, that you need to click on the NetworkManager's applet, if you didn't choose "Automatic Connect" and activate the connection.)

And now you know, why I clearly prefer a lot of Linux experience in profiles or curriculum vitae, when my employer hires: People who deal with that stuff should be ready for the problems we provide them with...

  

Tuesday, December 9, 2008

VMWare and key maps on Fedora 10

I am one of those poor souls who require Windows for some tasks. I wish, this weren't the case, but that's how things are. Fortunately, VMware Server comes to my rescue: A comparatively small VM of about 15GB is sufficient.

However, after my recent upgrade to Fedora 10, I suddenly noticed that some of my keys were no longer working in the VM: This included the arrow keys, but also some keys, which have been reachable via "Alt Gr" only, like '@', or '\'.

A quick search on Google revealed that I am far from being the only one bothered with that problem. In fact, the difficulties are more likely related to a Kernel upgrade. Users of Ubuntu 8.10 with a similar new kernel seem to suffer the same trouble. Fortunately, solutions were always at hand. For example, the VMware support suggests to use


xkeymap.usekeycodeMapIfXFree86 = true


or


xkeymap.usekeycodeMap = true


in ~/.vmware/config. Other sources proposed a list of explicit code settings instead, like


xkeymap.keycode.108 = 0x138 # Alt_R
xkeymap.keycode.106 = 0x135 # KP_Divide
xkeymap.keycode.104 = 0x11c # KP_Enter
xkeymap.keycode.111 = 0x148 # Up
xkeymap.keycode.116 = 0x150 # Down
xkeymap.keycode.113 = 0x14b # Left
xkeymap.keycode.114 = 0x14d # Right
xkeymap.keycode.105 = 0x11d # Control_R
xkeymap.keycode.118 = 0x152 # Insert
xkeymap.keycode.119 = 0x153 # Delete
xkeymap.keycode.110 = 0x147 # Home
xkeymap.keycode.115 = 0x14f # End
xkeymap.keycode.112 = 0x149 # Prior
xkeymap.keycode.117 = 0x151 # Next
xkeymap.keycode.78 = 0x46 # Scroll_Lock
xkeymap.keycode.127 = 0x100 # Pause
xkeymap.keycode.133 = 0x15b # Meta_L
xkeymap.keycode.134 = 0x15c # Meta_R
xkeymap.keycode.135 = 0x15d # Menu


In my case, none of these solutions worked completely. The hex codes were refused by VMware Server and the usekeycodemap stuff was fixing some keys, but not all. It turned out, that I had to convert the hex key codes to decimal in order to get it working. For the convenience of those who share my trouble, I post my settings here:


xkeymap.keycode.108 = 312 # Alt_R
xkeymap.keycode.106 = 309 # KP_Divide
xkeymap.keycode.104 = 284 # KP_Enter
xkeymap.keycode.111 = 328 # Up
xkeymap.keycode.116 = 336 # Down
xkeymap.keycode.113 = 331 # Left
xkeymap.keycode.114 = 333 # Right
xkeymap.keycode.105 = 285 # Control_R
xkeymap.keycode.118 = 338 # Insert
xkeymap.keycode.119 = 339 # Delete
xkeymap.keycode.110 = 327 # Home
xkeymap.keycode.115 = 335 # End
xkeymap.keycode.112 = 329 # Prior
xkeymap.keycode.117 = 337 # Next
xkeymap.keycode.78 = 70 # Scroll_Lock
xkeymap.keycode.127 = 256 # Pause
xkeymap.keycode.133 = 347 # Meta_L
xkeymap.keycode.134 = 348 # Meta_R
xkeymap.keycode.135 = 349 # Menu

Thursday, November 27, 2008

Fedora PreUpgrade

You've got to learn every day, that's for sure. Sometimes it's tedious (yes, I admit to being so old as no longer love learning for its own sake), but sometimes it's nice. An example of the latter was today when I read about Fedora PreUpgrade.

A while ago, I wrote about UNetbootin, a very nice utility for starting Linux installation or live cd's like GPartEd from a running system without burning a CD or DVD. I've been using it since then and will do so in the future. However, in the case of Fedora, CentOS or Red Hat Enterprise Linux upgrades, using UNetbootin has its limitation. (Which is, of course, not the fault of UNetbootin, but a limitation of these distributions, in the latter simply referenced as Fedora.)

For upgrade of Fedora, there are basically two options:

  1. The officially supported way is using the Anaconda Installer. That means booting from a CD, DVD (or via UNetbootin :-). That's nice, if you have a DVD ready and also have direct access to the system.
  2. The officially unsupported way is using Yum. Much better in some aspects: You can do it from within a running system, even remotely. However, if you are reading the Yum Upgrade FAQ, then you cannot fail to notice that there seem to be a lot of traps and possible problems. I have had my share of these in the past, for example when the IDE devices have been renamed from /dev/hdx to /dev/sdx: At that point you could bet your house on Yum upgrades failing.
    For similar reasons, the Yum upgrade should not happen with a UI running. If you are actually using the machine (for example on your own desktop), then that means a lot of more downtime than you want. (Ok, you might use the download-only plugin... I am ranting, but there's a reason for this Blog's title...)


In other words, you either got to do it safe (Anaconda) or nice (Yum). No longer: Use PreUpgrade.

It's a small python utility with a UI. You start it. It connects to the Fedora server and gathers a list of releases, which are available for an upgrade. (This might include alpha and/or beta releases, if you like.) Proxy servers are supported, btw., I did not check, whether it uses http_proxy, yum.conf, or both. You select a release and click on "Apply". After that, it automatically calculates dependencies and loads the required RPM's to your hard drive. So far, you' ve got the advantages and the comfort of Yum.


But that's not all. In the next step, PreUpgrade is loading a kernel image, a ram disk and similar stuff to your hard drive and configures your system for using them at the next reboot: In other words, it does what UNetbootin would, for you.

All this is happening in the background. You can continue your work, no downtime so far. Finally, when PreUpgrade is finished, you may click on Reboot: Anaconda comes up, performing a safe installation without downloading anything or using a slow CDROM drive.

By using PreUpgrade, I have just upgraded from Fedora 9 to Fedora 10. My downtime was about 10 minutes. (Excellent possibility to get some coffee!) Aint this magic?