University of Oregon

Repair dhcp issue in Linux VM: "Device eth0 does not seem to be present".

I have Parallels Linux VM that was shared by a co-working and I couldn’t establish an external network connection.
This proved to be really difficult to troubleshoot. I like Linux but I’m not fluent. My first issue was that the “Network settings” preference GUI was missing (perhaps because of the network failure on startup). Then the CMD Line version (system-config-network) wasn’t very helpful either.

So this morning I open another copy of the VM to start with a clean slate.
This time I notice an error message icon at the bottom of the log-in screen. I looked through the log and saw a couple of failures. The first one caught my eye: “Bringing up interface eth0; Device eth0 does not seem to be present, delaying initialization.” [failure]

I searched Google for that sentence and found this post that outlined the exact fix I needed: http://kezhong.wordpress.com/2011/02/04/solving-the-problem-unable-to-activate-nics-after-moved-the-hard-driver-from-a-machine-to-another/

So I confirmed that the OS changed eth0 to eth3 on startup and wasn’t able to get a dhcp. Here are the steps I used (## = comments).

Cmds:

#Result: #Verify Error:
$ sudo service network restart
$ dmesg|grep eth
    ## Result: "udev: renamed network interface eth0 to eth3"
$ cd /etc/sysconfig/network-scripts;
$ sudo mv ifcfg-eth0 ifcfg-eth3
$ sudo vim ifcfg-eth3
    ## Change: DEVICE="eth0" to DEVICE="eth3"
    ## Save: :wq
$ sudo service network restart
    ## Result: "Bringing up interface eth3:  Device eth3 has different MAC 
address than expected, ignoring."
## Get the MAC addresses, and append it to ifcfg-eth3 files.
$ sudo cat /sys/class/net/eth3/address >> ifcfg-eth3
    ## Permission denied
## You can either set the root password or just hand type the mac address
$ su root
$ cat /sys/class/net/eth3/address >> ifcfg-eth3
$ exit
$ sudo vim ifcfg-eth3
    ## Change: HWADDR="… to match the appended mac address and delete appended
 text.
    ## Save: :wq
$ sudo service network restart

Success!
Now I have internet connectivity for the VM!

*This worked for the 2nd copy of the vm I imported as well but in that case eth0 was changed to eth1.

In retrospect I suppose the eth0 was changed because I “copied” the image into parallels. The other option is to “move” the image. But I found that if the network detects two machines with the same MAC Address it stops it cold.

Drupal & shell bookmarklet for updating modules 5 (updated – mulitple dbs, backup only option)

*Note: This is a follow up to the posts:

First off: here is the bookmarklet:
This first one is bare-bones; you get prompted for every var:
Install Mods Prompt

This next one needs to be customized to contain your directory and server data but then you don’t have to answer questions every time:
Install mods mysite
You can use http://subsimple.com/bookmarklets/jsbuilder.htm to edit the bookmarklet and set the defaults before saving it.

Now for the details:
I’ve refined the module install bookmarklets once again.
As with the previous versions: click the bookmarklet on a Drupal project page, pick the module and get the ssh script to install it.
Click the bookmarklet on your admin/reports/updates and get the code to install all the recommended updates.
This is tailored to work on our server and doesn’t work on our shell environment. Although it could with some modifications.
At this point you need to cut and paste the file and database backup lines independently because they each require passwords.
I’ll work towards a version that allows a single cut and paste.
(more…)

Drupal & shell bookmarklet for updating modules 4 (updated – bookmarklet w/ base code)

*Note: A new post is available here: Drupal & shell bookmarklet for updating modules 5 (updated – mulitple dbs, backup only option)

This is a follow up to the posts:

Here they are.
This first one is bare-bones; you get prompted for every var:
Install Mods Prompt

This one needs to be customized to contain your directory and server data but then you don’t have to answer questions every time:
Install mods mysite
You can use http://subsimple.com/bookmarklets/jsbuilder.htm to edit the bookmarklet and set the defaults before saving it.

Details
I’ve refined the module install bookmarklets again.
I considered abandoning these in favor of the drush component but drush requires php 5.2 and we’re still using 5.1 at this point.
This works pretty well for me. Click it on a Drupal project page, pick the module and get the ssh to install it.
Click it on the admin/reports/updates and get the code to install all the recommended updates
(more…)

Drupal & shell bookmarklet for updating modules 3 (updated – wget bookmarklets)

*Note: A new post is available here: Drupal & shell bookmarklet for updating modules 5 (updated – mulitple dbs, backup only option)

This is a follow up to the post: Drupal & shell bookmarklet for updating modules
Also see: Drupal & shell bookmarklet for updating modules 2 ->just Recommended

I’ve refined the module install bookmarklets. These put the vars you might want to customize at the top so you aren’t changing the details every time:
For example:

  var siteDirName='site_directory';
  var siteBasePath='/var/www/html/';
  var backupBasePath='/home/yourName/drupal_backup/';
  var dbUser='drupal6-db-user';
  var dbName='drupal6-db';
  var serverName='myServer';
 

You can use http://subsimple.com/bookmarklets/jsbuilder.htm to edit the bookmarklet and set the defaults to suit your set up.

I use this first one on the admin/reports/updates page (where I know jQuery is installed) to capture all the ‘recommended’ updates and output them to a shell script that I cut and paste into terminal. Each update is fetched via wget, unpacked into my modules directory, overwriting the old module and then the zip file is removed.

After all the files have been processed, the directory is listed and the db and site is backed up.
Then I can begrudgingly go to the update page and run the script.

install all mods jQuery var

javascript:(function(){var siteDirName='site_directory';var siteBasePath='/var/www/html/';var backupBasePath='/home/yourName/drupal_backup/';var dbUser='drupal6-db-user';var dbName='drupal6-db';var serverName='myServer';var date=new%20Date();var saveDate=date.getMonth()+1+'-'+date.getDate()+'-'+date.getFullYear();var connect=confirm('Would%20you%20like%20to%20include%20the%20connection%20information?');var shellLocation=prompt('What%20is%20the%20location%20of%20your%20install%20directory?',siteBasePath+siteDirName+'/sites/all/modules/');var shellText=%22%22;if(connect){shellText='##ssh%20'+serverName;}if(shellLocation!==null){shellText=shellText+'<br />cd%20'+shellLocation;}with($('table.version-recommended%20td%20li.update-download%20a').each(function(){q=this.href.toString().split('/').pop();if(q!==%22%22&amp;&amp;this.href!=%22%22){shellText=shellText+%22<br />wget%20%22+unescape(this.href);shellText=shellText+%22<br />gzip%20-dc%20%22+escape(q)+%22%20|%20tar%20-x%22;shellText=shellText+%22<br />rm%20%22+escape(q);}}));if(connect){shellText=shellText+%22<br />wait%22;shellText=shellText+%22<br />ls%20-al%22;shellText=shellText+%22<br />sudo%20tar%20-c%20--checkpoint%20%22+siteBasePath+siteDirName+%22/%20|%20bzip2%20&gt;%20%22+backupBasePath+siteDirName+saveDate+%22.tar.bz2;%20%20##Backupfiles%22;shellText=shellText+%22<br />mysqldump%20-u%20%22+dbUser+%22%20-p%20%22+dbName+%22%20&gt;%20%22+backupBasePath+siteDirName+saveDate+%22.sql;%20%20##BackupDB%22;}if(shellText!==%22%22){if(window.clipboardData){window.clipboardData.setData('Text',shellText);}else{wnd=open('','Shell_Command','width=650,height=400,top=0,left=0,scrollbars,resizable');with(wnd.document){writeln('<pre>');writeln(shellText);writeln('</pre>');}wnd.document.close();}}/*if%20shellText!==%22%22*/})()

You’ll have to paste that in to your url bar as something about the syntax breaks the link in wordpress…
But you can grab the bookmarklet here: http://uoregon.edu/~vid/v_drupal_bookmarks.php. It’s the first one in the list.
(more…)

Drupal & shell bookmarklet for updating modules 2 ->just Recommended

Note *A new post is available here: Drupal & shell bookmarklet for updating modules 5 (updated – mulitple dbs, backup only option)

I just posted about a bookmarklet I wrote to help with processing drupal module updates.
After looking at the update (admin/reports/updates) page today. I noticed that there are occasionally more than one download link for each module. Some marked ‘Also available:’ as well as ‘Development Version’. So the new challenge is finding the recommended one.

After a bit of thinking I worked out a new bookmarklet. This time capitalizing on jQuery to grab the desired links:
Install all mods jQuery

It’s quite a bit shorter than the last version. 1164 characters vs. 2433 characters.
I would suspect that if I knew more jQuery I could replace quite a bit more as well; though most of the savings are related to the lack of selection highlight or direct entry support. The other bookmarks (wget in particular) will still be quite handy for installing from the Drupal site. (more…)

Drupal & shell bookmarklet for updating modules

*Note: A new post is available here: Drupal & shell bookmarklet for updating modules 5 (updated – mulitple dbs, backup only option)
There is a follow up to this post here: Drupal & shell bookmarklet for updating modules 2 ->just Recommended

Here are some bookmarks I’ve been working on to help make Drupal module updates easier.

These are currently just for my convenience. Which means I haven’t done any cross-browser testing. I only use them in Firefox on Mac at this point. Feel free to make use of the code and update it as you see fit. Personally I’ve created versions without all the pop up prompts for my primary sites.

The idea behind these is that when you are on your admin/reports/updates page you can choose a download and get the script you need to get the job done without having to type it from scratch each time. I’ve been using the ‘Install all mods wget’ one to download and install new modules from the Drupal site or Open Atrium as well. Infact anytime I see a tar.gz link that I want to unzip and install I click this one.
(more…)

Protected: Changing file names on the server (step by step)

This content is password protected. To view it please enter your password below: