RSS
 

Archive for the ‘sysadmin’ Category

Hosting That Repository

08 Nov

Collection of file boxes symbolizing .deb packages
Several weeks back I wrote about setting up a local repository for .deb packages. Well we’re growing and adding machines, so it was time to move that local repository to a centralized location.

It shouldn’t be hard, but it did have a few more steps than I hoped. The essence was around building the repository through a framework, and for that, a number of posts led me to reprepro.

According to its man page and sparse documentation, reprepro is “a tool to handle local repositories of debian packages,” which sounded exactly like what I wanted.

The steps were fairly straightforward, albeit with one gotcha that took me about an hour to puzzle through.

Build the package

The first step is an obvious prerequisite. However, one step missing from what I described in Building Custom .deb Packages and Chroots was the requirement to specify Section (e.g. Main, non-free, etc.) and Priority sections. Without this, reprepro will give the cryptic (though, in retrospect, obvious) error “No section given.” (Maybe if the ‘s’ was capitalized I wouldn’t have assumed this was based on the reprepro config file, instead of the package itself). Oh well.

Create a repository

Joseph Ruscio explains this part pretty well; in essence, you:

  1. Generate the PGP key: gpg --gen-key should get you pretty much all you need here. If you want the repository to be owned by another user, you’ll have to sudo into that account and ensure that user has a ~username directory (which system accounts will not, by default)
  2. Create the repository control files: At the minimum, reprepro will need a subdirectory called conf underneath wherever your repository will live. Inside that dir, create a file distributions that contains the reprepro setup. Here’s mine, to diff against the other online examples:
    Origin: http://myhostname.path.com
    Label: Edge Apt Repository
    Codename: es
    Architectures: i386 amd64
    Components: non-free
    Description: A generic description.
    SignWith: yes
    

    Details of the various settings are in the man page; I think these are the only mandatory ones.

  3. Create an options file: If you want to save yourself some command-line time, you can create a conf/options file like so:
    verbose
    ask-passphrase
    basedir .
    
  4. Run reprepro: The command is simple:
    reprepro includedeb [codename] [path to .deb file]
  5. Make the repository available over http: The various articles linked above show how to set up a virtual host or path pointing to your new repository. For security purposes you should hide the conf and db directories from the public, and depending on how broadly you’re allowing distribution, play with your webserver’s permissions to restrict by IP, domain, or password. Basically, you just need to make sure that apt on your client machine (where you’re installing to) can browse the directory you’ve created above.
  6. Edit /etc/apt/sources.list on the client machine(s): You’ll simply add a row to point to this new directory, the codename you specified, and the source you specified in the package (e.g. non-free). Here’s mine:
    deb http://myhostname.edgesentinel.com/
  7. apt-get update



And that’s it!
Happy distributing.

/m

 
No Comments

Posted in sysadmin

 

VMware Tools on Ubuntu Server 10.04

02 Sep

All of the help I could find for setting up Ubuntu in a VM (using VMware Fusion on my Mac) assumes you’re using the Desktop version, with all the pretty Gnome/Nautilus crap prettiness. In case anybody else gets stuck trying to install the VMware Tools (to provide useful features like access to your host (Mac) filesystem and clipboard sharing), here’s the steps:

  1. In Fusion, select Virtual Machine | Install VMware Tools... menu option. This option emulates a CDROM being inserted, but without Nautilus your guest OS won’t do anything until you…
  2. Mount the CDROM by typing sudo mount /dev/cdrom /mnt (substitute /mnt if you want the mount point to be elsewhere)
  3. cd /mnt (or wherever your mount point was)
  4. cp VMwareTools* ~/ to copy the archive to your home directory
  5. cd to move yourself to that home directory
  6. umount /mnt to unmount the CDROM
  7. tar zxf VMwareTools* to uncompress the archive
  8. cd vmware-tools-distrib to get into the contents
  9. And finally, sudo ./vmware-install.pl to run the installer

At this point the installer will walk you through the options; I just accepted all the defaults.

To turn on shared folders, go to the Virtual Machine | Shared Folders menu and configure from there. The vmware tools daemon should detect the changes and make those folders appear under /mnt/hgfs (which stands for Host Guest FileSystem).

Good luck.
/m

 
1 Comment

Posted in sysadmin

 

Static IP for VMWare Fusion

26 Aug

While trying to test an Apache installation running inside a VMWare Fusion instance, I found something irritating: Every time my Mac resumed from sleep, the IP address the guest OS used would increment by one, meaning whatever test scripts I was running from Safari or Firefox on my Mac would need to be adjusted to the new IP. Irritating.

The solution, fortunately, was quite simple, and came compliments of Craig Box:

  1. Run ifconfig inside the guest OS (the Ubuntu image, in my case) to find the MAC address of your virtual adapter
  2. Back on the Mac side, edit the bottom of /Library/Application Support/VMware Fusion/vmnet8/dhcpd.conf (outside the “DO NOT MODIFY SECTION” tags) to create a static assignment that looks like:
    host developer-vm {
            hardware ethernet 00:0c:29:0e:5f:3f;
            fixed-address 192.168.139.100;
    }

The only note is that whatever fixed-address you assign must be within the randomly-assigned class-C subnet that VMWare is already using (i.e. the 192.168.nnn.0/24 that you’ve been getting dynamic addresses within; mine is “139″ above) ; if you need to change yours, that needs to be updated in /Library/Application Support/VMware Fusion/networking

To restart the service, you can reboot your VM. Theoretically, you can also try
sudo "/Library/Application Support/VMware Fusion/boot.sh" --restart and then trigger a DHCP Refresh within the VM, but that seemed like overkill to me…

Good luck!
/m

 
No Comments

Posted in sysadmin

 
 
Info about our use of ads