Booting in to a clean installation of Ubuntu 12.04 (Precise) with VMWare Tools installed I get a Could not apply the stored configuration for monitors error:
Could not apply the stored configuration for monitors.
The solution is to remove monitors.xml from /home/<username>/.config.
To do this I opened a Terminal and changed the directory to .config:
cd .config
I backed-up and then deleted monitors.xml:
cp monitors.xml monitors.bak
rm monitors.xml
I rebooted for good measure – now VMWare Tools adjusts my resolution without errors.
I first encountered this issue a long time ago and forgot to document it – so now I had to resolve it again.
I’m running Notepad ++ on Windows and using WinSCP to transfer bash scripts to Ubuntu Server. My script is saved as an Unix script file (*.sh, *.bsh) in Notepad++ and WinSCP is set to transfer files in binary mode.
When I run the script on Ubuntu Server I get the following error:
: No such file or directory
I could see the problem in Notepad++ and in nano on Ubuntu Server when I wanted to save the file – the file was formatted for Dos\Windows.
Notepad ++ document format set to Dos\WindowsNano saving .sh as Dos Format
The fix is to change the formatting to UNIX. In Notepad ++ click Edit, EOL Conversion and UNIX and save the file.
I have been using Gregarius as my web-based RSS aggregator for quite some time now but have wanted to try Tiny Tiny RSS for a while.
Now that WebUpd8 have created a PPA (Personal Package Archives) for Tiny Tiny RSS I really had no excuse for not installing it.
Note: I am installing Tiny Tiny RSS on Ubuntu Server 12.04. PPAs have been available for Ubuntu since Ubuntu 9.10 – so this will not work on prior editions of Ubuntu Server.
The first step is to update our repositories and install Apache and MySQL:
Set the URL for the Tiny Tiny RSS installation – for a local install on my LAN i used http://localhost/tt-rss/:
Select Yes for database configuration:
Confirm MySQL as the database for Tiny Tiny RSS:
Enter your root MySQL password:
Enter a password for Tiny Tiny RSS to register with MySQL – a random password will be generated if left blank:
Confirm your application password:
Next we need to use nano to edit some configuration files.
First we need to edit our server address in /etc/tt-rss/config.php:
sudo nano /etc/tt-rss/config.php
Find the line define('SELF_URL_PATH', 'http://yourserver/tt-rss/'); and change it to define('SELF_URL_PATH', 'http://localhost/tt-rss/'); (as per the server address that we set previously):
Press Ctrl + O then Enter to save the changes to config.php and then Ctrl +X to exit nano.
To get Tiny Tiny RSS to update feeds we need to edit /etc/default/tt-rss:
sudo nano /etc/default/tt-rss
Change DISABLED=1 to DISABLED=0 to allow the Tiny Tiny RSS daemon to be started:
Press Ctrl + O then Enter to save the changes to config.php and then Ctrl +X to exit nano.
Start the Tiny Tiny RSS service:
sudo service tt-rss start
Obtain the IP address of your Ubuntu Server installation:
ipconfig
Open a browser on another machine and navigate to your Tiny Tiny RSS URL:
Login with the username: admin and the password: password.
Click Actions, Preferences and Users to change your admin password and add users. You can import feeds under the Feeds tab or click Exit Preferences and then Actions, Subscribe to feed to add feeds manually.
On Ubuntu the hostname is stored in both the /etc/hosts and /etc/hostname files. There are several ways that we can change the hostname in these files.
1. Manually Edit the hostname
We can manually edit these files using a basic text editor like nano:
sudo nano /etc/hosts
sudo nano /etc/hostname
In /etc/hostname simply overwrite the existing hostname with a new one. In /etc/hosts you will find the hostname on the line beginning 127.0.0.1 – overwrite only the hostname with the new one, and then reboot.
Editing /etc/hosts using nano
sudo reboot
2. Use sed to change the hostname
Another way to achieve the same goal is to use the sed command to replace the existing hostname with a new one.
For example, my Ubuntu Server has the default hostname of ‘ubuntu’.
Use the hostname command to check what your hostname is.
With sed we can look for our hostname (in /etc/hosts and /etc/hostname) and then replace it with the desired new-hostname:
sudo sed -i 's/ubuntu/new-hostname/g' /etc/hosts
sudo sed -i 's/ubuntu/new-hostname/g' /etc/hostname
Reboot:
sudo reboot
3. Write a Bash Script
It’s always handy to have a script to do things – so here is a quick bash script that I put together that uses sed to change the hostname and then reboot:
#!/bin/bash
#Assign existing hostname to $hostn
hostn=$(cat /etc/hostname)
#Display existing hostname
echo "Existing hostname is $hostn"
#Ask for new hostname $newhost
echo "Enter new hostname: "
read newhost
#change hostname in /etc/hosts & /etc/hostname
sudo sed -i "s/$hostn/$newhost/g" /etc/hosts
sudo sed -i "s/$hostn/$newhost/g" /etc/hostname
#display new hostname
echo "Your new hostname is $newhost"
#Press a key to reboot
read -s -n 1 -p "Press any key to reboot"
sudo reboot
I’ve lost count of the number of times that I have installed Ubuntu Server on my VMware vSphere box – so I finally looked in to performing an unattended install.
I could have setup DHCP and TFTP servers and done PXE boot from images over the network – but I wanted to work on something quicker than that (and I don’t have that much spare RAM on my vSphere box as it is).
So I settled on re-mastering an Ubuntu Server .iso image. The result is an unattended install, except for the initial boot screen (where I need to select a minimal virtual machine installation anyway).
The following steps were performed on Ubuntu Desktop.
Open a Terminal and create a directory to mount the Ubuntu Server iso to.
sudo mkdir -p /mnt/iso
The -p switch is very useful as it allows you to create a directory structure which does not already exist (as opposed to creating a single directory).
Change directory to Downloads:
cd Downloads
I renamed my download UbuntuServer.iso.
Mount UbuntuServer.iso to /mnt/iso:
sudo mount -o loop UbuntuServer.iso /mnt/iso
Create a directory and copy the mounted Ubuntu Server files:
The -r switch copies directories recursively and -T specifies no (singular) target directory.
Now we have a copy of our Ubuntu .iso to work on in /opt/serveriso – but we need to make these files writable:
sudo chmod -R 777 /opt/serveriso/
With this preparation done we can start customizing things.
If we look at the isolinux/langlist file we see all the supported languages listed that Ubuntu supports (in an abbreviated format):
am
ar
ast
be
bg ...
I am only interested in an English install so I am going to overwrite the contents of isolinux/langlist with the single abbreviation for English, which is “en”.
cd /opt/serveriso
echo en >isolinux/langlist
This stops the language selection menu from appearing during installation.
The next step of the process is to create a kickstart file – this will provide the server install with the answers to the various questions asked during installation, such as timezone, username, password, partition structure and so on.
Install Kickstart Configurator:
sudo apt-get install system-config-kickstart
Click the Dash button and type kickstart and then click on the kickstart application.
Obviously you should customize your settings as you see fit – I have provided mine for reference.
Basic Configuration: Set TimezoneInstallation Method: Choose the CD-ROM installation method
Partition Options: Add an ext4 partition to the root file system that fills all unused space on the diskPartition Options: Add a swap file system that uses the recommended swap sizeNetwork Configuration: Add network device eth0 and set to DHCPUser Configuration: Provide username and password
Click File, Save File and save the kickstart file ks.cfg to /opt/serveriso.
While using the Kickstart Configurator you may have noticed that the Package Selection screen did not work. Fortunately we can manually edit the ks.cfg file so that the packages that we want are installed during Ubuntu Server installation.
At the end of ks.cfg add %packages and then list the packages that you want installed. I chose to install nano, openssh-server and open-vm-tools:
Test your .iso in a virtual machine to make sure that everything works as it should.
The minimal interaction that I need to set my Ubuntu Server install going is documented below:
Press the Enter key to confirm the English language selectionPress F4, select Install a minimal virtual machine, and then press EnterPress Enter to install Ubuntu Server
From here installation continues without any further input being required.