Categories
Unix

Fedora Xorg.conf Three Monitors Update

I have a Fedora system running with 3 monitors and recently did a yum update that did something to make the three monitors not all come back up properly when rebooted.

I have two monitors on DVI and one is VGA, I had to alter my ModeLine entry to get things back to normal, from:

Modeline “1680x1050_60.00”  147.14  1680 1784 1968 2256  1050 1051 1054 1087  -HSync +Vsync

to

ModeLine       “1680×1050” 119.00 1680 1728 1760 1840 1050 1053 1059 1080

Option       “PreferredMode” “1680×1050”

Now just as a note, the monitor DID come back if I just removed the ModeLine entry all together, but then the VGA screen was a low resolution. Hope this helps someone!

Categories
Unix

Pure-FTPD with TLS, “Certificate verification: Not trusted” Error

I run a few FTP servers that use Pure-FTPD with TLS on it for extra security, and on the ones that don’t have a “real” SSL cert, you will see the following when using LFTP and trying a “ls”:

ls: Fatal error: Certificate verification: Not trusted

The way to work around that is to add the following to your “.lftp/rc” file:

set ssl:verify-certificate no

And you are good to go!

Categories
Unix Windows

Using virt-install with KVM to install Windows XP

As a follow-up to my post on installing centos 6x using KVM, I have since had the need to install a winXP ISO on my KVM host. I had to play with the commands a bit before hitting upon the right mix, so here it is:

virt-install --name=vm_xp --ram=512 --vcpus=1,cores=1 \
--disk path=/opt/vm_xp.img,size=4 --network bridge=br0 \
-c /opt/en_winxp_pro_sp3.iso --os-variant winxp --os-type windows --hvm \
--graphics vnc,password=1234,port=5905,listen=192.168.2.10
Categories
Cellphone Unix

SSH/SCP times out on cellular network

I have a centos box I use when travelling and use an AT&T cellular USB modem on it for connectivity. I ran into an interesting problem when connecting in Las Vegas — I could get SSH sessions working fine up to a point, but when a lot of text was being outputted, the session would freeze and the connection would timeout.

This would happen when running “top”, or even if you started a “vi” session!

This looked like an issue with packet sizes, so I tried SCP’ing different file sizes and found that it would break at 1375 bytes when sending a file. After setting my MTU to 1370 the problem went away. The MTU was set to the default of 1500 prior.

So I must conclude that AT&T’s network in Las Vegas has a different network/routing setup than they use in other areas, because I have not see this problem before in California or a number of other states across the country.

For reference, the steps to fix this are:

ifconfig ppp0 mtu 1370

and then you can edit the config file, in my case “/etc/sysconfig/network-scripts/ifcfg-ppp0” and add:

MTU=1370

to the entries there.

 

Categories
Unix

Installing CentOS 6x on KVM

I’ve been installing CentOS 5.8 VM’s for a while now using KVM/Virsh and setting the serial port so I could do “virsh console” and do the CentOS setup in text mode. Since all my servers are essentially headless I turn off graphics and do the text install.

This had been working great until I started moving up to the version 6 release, and I tried everything up to 6.4 with the same results — it would do a condensed version of the install (i.e., it would stop prompting me to customize the drive partitioning, and would not let me customize the networking among other things) and then it would prompt for “reboot”. Once it was booting, it would hang on “Starting crond”. I went into “I”nteractive mode and found the next item in the boot process was “local” which could point to graphics problems. I tried the ISOs for 6.1, 6.2, 6.3, 6.4 both the full installations and also the network installation versions, all with the same results.

So I switched to doing a graphics install with VNC. This did the trick, but was not as clean since I had to use the VNC interface to then go in and set up networking and get it ready for access. In the old text method you could easily edit and paste from window to window for the configuration, the VNC viewer prevents easy copy/paste from other windows and limits you to 24 rows as it displays the console. But at least I got 6.4 running.

Here is the virt-install command I used:

virt-install –name=vm_test –ram=8000 –vcpus=4,cores=4 \

–disk path=/home/vm/vm_test.img,size=300 –network bridge=br0 \

–location /home/vm/CentOS-6.4-x86_64-bin-DVD1.iso \

–graphics vnc,password=1234,port=5900,listen=192.168.10.10

I had to specify the listen IP otherwise it binds to localhost, and I needed to NAT my router to my internal 192 address.

After the install you can “virsh edit” your VM to remove the graphics section so you don’t have a VNC hole laying around.

My next step was to make sure I could still use “virsh console” to access from a command prompt, I’ll do a separate post on that.

Categories
Unix

CentOS bootup hangs at iptables

I experienced an odd thing the other day when I went to reboot a server it was hanging at bootup at the iptables/firewall portion of the startup sequence.

I had to do “Interactive” bootup (by hitting “I”) and then I could say “n” on the firewall section. After that it booted up fine.

I examined my iptables and some postings on the ‘net will mention that failing to have the loopback interface in the rules, i.e. “-A RH-Firewall-1-INPUT -i lo -j ACCEPT”. I verified I had that, and then I realized that I also had a rule in place that was generated by an auto-rule script that uses IPs from failed attempts in log files. Somehow it had gotten 127.0.0.1 in there! I had to remove a blocking rule for 127.0.0.1 and then it worked.

So, rule of thumb, take care of what goes in your iptables file!

Categories
Unix

Restoring damaged /boot from XEN guest

I have a number of XEN and KVM virtual machines and I just had a case where one XEN guest had a problem with the new kernel I upgraded to. It would not boot, showing Error: (2, ‘Invalid kernel’, ‘xc_dom_parse_elf_kernel: ELF image has no shstrtab\n’) when the “xm create” was performed.

So I had to get into the /boot and fix the kernel and the grub.conf. How to do that safely on an image? Well it seems you CAN mount ext3 and other filesystems, but you CANNOT mount LVM or swap partitions. So fortunately the boot partition was ext3. Here are the set of commands I used to mount the image, vm01.img:

losetup -a

losetup /dev/loop5 vm01.img

fdisk -l /dev/loop5

lomount -t ext3 -diskimage vm01.img -partition 1 /mnt

Then you can go into /mnt and alter the kernels and edit grub/grub.conf. Once mounted, you can copy over new kernel files, but typically the /boot partition is a smaller size than the rest of the disk. I actually had some files I wanted to also copy over into /lib later, and they were needed for the networking to work. So I put them in gzipped tarballs in /boot a portion at a time and then when I would boot into the uncomplete setup I could copy them into place. A hack for sure, but that’s how I got more files over throughout the process.

Then, when done:

umount /mnt

losetup -d /dev/loop5

You need to do this to cleanly close the image. Then you can “xm create” your fixed up image!

 

 

Categories
Unix

yum install subversion fails with “package is already installed”

I have a new CentOS installation in place using utterramblings.repo and got this mesage when doing a “yum install subversion”:

Transaction Check Error:
package apr-1.4.5-1.jason.1.x86_64 (which is newer than apr-1.2.7-11.el5_6.5.i386) is already installed
package apr-util-1.3.12-1.jason.1.x86_64 (which is newer than apr-util-1.2.7-11.el5_5.2.i386) is already installed

Now some posts on the ‘net say to do a “yum downgrade” but that seems just unreasonable! Instead, the solution was to only install the X86_64 version! So the following worked:

yum install subversion.x86_64

Categories
Unix

Expanding disk space on a KVM virtual machine

I use KVM on CentOS 6.2 and had a need to expand the disk space for one of the VMs. In some cases, it makes sense to have the VM’s disk space relatively small before you know how much you are going to need, and then expand it when ready. I hate having a few VMs that are running at 20% disk usage, knowing that I am wasting space. Of course, you could use your VM with auto-expanding space, but I don’t want the trade-off of reduced disk access speed.

So, in a succinct fashion here are the steps I used to get this done! In this example, my vm is called “vm10” and I’m adding 200G

  • <shutdown your VM if running>
  • <cd into your VM image directory>
  • mv vm10.img vm10.img.bk
  •  qemu-img create -f raw addon.raw 200G
  • cat vm10.img.bak addon.raw >> vm10.img
  • <start the VM>
  • fdisk /dev/vda
  • p
  • d
  • 2
  • p
  • n
  • p
  • 2
  • <enter>
  • <enter>
  • p
  • t
  • 2
  • 8e
  • p
  • w
  • reboot
  • pvdisplay
  • pvresize /dev/vda2
  • lvresize /dev/VolGroup00/LogVol00 -l +100%FREE
  • resize2fs /dev/VolGroup00/LogVol00
  • reboot

And there you go! A newly sized VM.

Categories
Unix

“containing working copy admin area is missing” in SVN

I was recently working with SVN and somehow a directory got fubar’ed and I was getting that message when trying to commit.

The resolution was to do a fresh checkout in a temp directory, then TAR up the .svn folder for my fubar’ed directory and copy it over to my current SVN workspace. I had to make sure I still added any files that were not added in the other .svn folder, but that was no problem and my issue was resolved!