Increasing a VirtualBox vdi’s disk space

One of the big problems with VirtualBox, is the seeming lack of support for increasing the hard disk size of a Virtual Machine (VM). The command line tool provided with VirtualBox, VBoxManage, serves as the tool to modify and increase your hard drive settings.

Let’s start with the problem of having a Windows 7 instance that has just run out of room. In order to update the instance, completely exit VirtualBox. Then go to your Terminal window so that we can enter VBoxManage commands directly. Change Directory to where your VirtualBox VMs are being stored. On my Macbook Pro, they are stored in my user directory: ~/VirtualBox VMs/Win7Pro. Now let’s increase the VM’s disk size. Let’s say the current instance is 20G and we want to double that to 40G. Before we do this, we must be sure the disk is dynamic: The following command performs this function –>

cyrokx@ves-l4 ~/VirtualBox VMs/Win7Pro –> VBoxManage showhdinfo Win7Pro.clone.vdi
UUID:                 d6b6c10e-0bff-45f3-9db7-b5c21a22dcea
Accessible:           yes
Logical size:         20480 MBytes
Current size on disk: 18448 MBytes
Type:                 normal (base)
Storage format:       VDI
Format variant:       dynamic default
Location:             /Users/cyrokx/VirtualBox VMs/Win7Pro/Win7Pro.clone.vdi

———————————————–

Since the Format variant is dynamic default, we can easily increase the disk size by running the following command –>

cyrokx@ves-l4 ~/VirtualBox VMs/Win7Pro –> VBoxManage modifyhd Win7Pro.clone.vdi –resize 40960

Your Virtual Machine is now 40G. Once in Windows, go to Administrative Tools -> Computer Management. Go to Disk Management and extend your existing partition with the newly created disk space.

Now if your Format Variant read: fixed default, there are a number of steps you must now do. Only dynamic disks can be increased in size. Fortunately we can clone VMs and the cloning process automatically creates a clone with a dynamic disk. In our hypothetical example above, we are now going to write the steps to perform to clone and resize the disk.

Resizing the disk is a little more than trivial. The key is to ensure you keep the same UUID on the disk.vdi image that VirtualBox has registered. To resize a disk that is fixed, you must first make a copy of the .vdi you wish to increase the size of. To accomplish all of this, we are going to use the following VBoxManage commands:

  1. >VBoxManage showhdinfo Original.vdi
    You should see a response similar to the following (be sure to copy the UUID, you’ll need it later) –>
    UUID:                 d6b6c10e-0bff-45f3-9db7-b5c21a22dcea
    Accessible:           yes
    Logical size:         20480 MBytes
    Current size on disk: 18448 MBytes
    Type:                 normal (base)
    Storage format:       VDI
    Format variant:       dynamic default
    Location:             /Users/cyrokx/VirtualBox VMs/Original/Original.vdi
  2. >VBoxManage clonehd Original.vdi newCloneOfOriginal.vdi
  3. >VBoxManage modifyhd newCloneOfOriginal.vdi –resize 40960
  4. >VBoxManage showhdinfo newCloneOfOriginal.vdi
    In the response of showhdinfo, you will see the UUID has changed. Next we need to change the cloned image’s UUID to that of the Original.vdi’s UUID.
  5. >VBoxManage internalcommands sethduuid newCloneOfOriginal.vdi d6b6c10e-0bff-45f3-9db7-b5c21a22dcea
  6. Now that you have a clone with the newly increased disk space, you need to copy it over the Original.vdi.
    >mv Original.vdi /some/place/special
  7. >mv newCloneOfOriginal.vdi Original.vdi
  8. Start the newly expanded VM!!

There you have it. A little cumbersome, but serves the same purpose. I tend to prefer to preallocate all of my disk space fixed. But this exercise may be enough to get me to change my mind…

 

Using Verifone RiTA software with IBM WAS

If you are running the RiTA software by Verifone, you may encounter a number of issues configuring the software to work in an IBM WebSphere environment. There are two issues you want to avoid:

  • Not being able to find the tid.jcc file
  • Not having the .jar files in the correct location

First, the tid.jcc needs to be in the default server directory for IBM WAS. On Linux, this will most likely be the /opt/IBM/WebSphere/AppServer/profiles/AppSrv01 directory.

To add the tid.jcc reference, you will want to link it from your RiTA installation directory (the default directory being /opt/rita). Run these commands:

>cd /opt/IBM/WebSphere/AppServer/profiles/AppSrv01
>ln -s /opt/rita/tid.jcc

Next, you will need to link all of the RiTA .jar files to your extensions directory in the Java Runtime Engine. Run these commands:

>cd /opt/IBM/WebSphere/AppServer/java/jre/lib/ext
>find /opt/rita/lib/rita -name ‘*.jar’ -exec ln -s {} \;

You will now have symbolic links to all of the RiTA .jar files and it will be accessible to WebSphere and all other Java applications.

Jasper Server could not insert error

In Jasper Server, you may encounter the following error:

org.hibernate.exception.GenericJDBCException: could not insert: [com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.ContentRepoFileResource]

This can be caused by having too many automated reports stored in your Content Files directory. Especially if there are number of large .xls (or any type of file).

Just be sure to keep this directory to less than 50 files, and you should be good!

Setting up a classless DNS with Bind9 on Ubuntu and Red Hat Linux flavors

Setting up a classless DNS is critical if you are setting up a mail server on your classless set of IPs. For instance, when my mail users send e-mails to Comcast, Cox, or Time-Warner, my mail is rejected with the following message between the stars:

********************

Subject: Undelivered Mail Returned to Sender

This is the mail system at host melon.skky.net.

I’m sorry to have to inform you that your message could not be delivered to one or more recipients. It’s attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can delete your own text from the attached returned message.

                   The mail system

<mailto:ddietrich@@socal.rr.com>: host hrndva-smtpin02.mail.rr.com[71.74.56.244] refused to talk to me: 421 4.7.1 – Connection refused.  Cannot resolve PTR record for 216.23.169.107

********************

In order to resolve this issue, you must ask your hosting provider to forward reverse DNS queries to your DNS server. Then, you can set up the reverse DNS for your classless range of IPs. Start by editing your named.conf file (/etc/bind/named.conf on Ubuntu, /var/named/chroot/etc/named.conf on Red Hat flavors). Add the following lines–>

zone “96/28.169.23.216.in-addr.arpa” {
 type master;
 file “/etc/bind/96-28.169.23.216.rev”;
};

In my case, my provider assigned me the range of 216.23.169.23.96-216.23.169.110. This is a /28 set of addresses. Notice how we reverse the zone entry. The Class D first, followed by a /, followed by the .Class C.Class B.Class A.in-addr.arpa. The filename roughly matches this as well. I called the file 96-28.169.23.216.rev. Just put this file in your /etc/bind directory on Ubuntu, or /var/named/chroot/var/named on Red Hat Linux flavors (RH5, CentOS, Fedora Core, etc.)

Now for the actual file 96-28.169.23.216.rev contents between the stars –>

****************************

$ttl 38400
$ORIGIN 96/28.169.23.216.in-addr.arpa.
@       1D      IN      SOA     ns1.wiretoss.com. ddietrich.localhost. (
                        1172404866
                        10800
                        3600
                        604800
                        38400 )
        NS      ns1.wiretoss.com.
        NS      ns2.wiretoss.com.
100     PTR     ns1.vitaven.com.
101     PTR     101.wiretoss.com.
102     PTR     102.wiretoss.com.
103     PTR     103.wiretoss.com.
104     PTR     104.wiretoss.com.
105     PTR     105.wiretoss.com.
106     PTR     106.wiretoss.com.
107     PTR     ns1.wiretoss.com.
108     PTR     108.wiretoss.com.
109     PTR     109.wiretoss.com.
110     PTR     110.wiretoss.com.
****************************

Restart bind9 and you should now have a happy reverse DNS to the rest of the world, and especially those pesky mail servers that check for everything.

Remount /etc/fstab without rebooting

Many times it would be nice to make changes to your /etc/fstab file. The problem is that you must reboot. No longer. Run the following command to remount your /etc/fstab file without rebooting –>

>mount -a

Everything should now be remounted and you can fix any errors that may have occurred with your new /etc/fstab entries.

Samba – Stop homes from showing in shares

When using Samba on Linux, there are times that you want to allow user to have a private user directory, but do not want the “homes” directory share to show up. This is relatively simple.

Edit your /etc/samba/smb.conf file with your favorite Linux editor.
Look for the section [homes] and find the line
browseable =

set this line to browseable = no

Restart Samba (>service smb restart) and your users should now see their personal directory without seeing the homes share.

If you do not have a [homes] section, here is an example on for you –>

[homes]
        hide dot files = no
        comment = Home Directories
        writeable = yes
        delete readonly = yes
        valid users = %S
        browseable = no

The Essential Startup Reader: 10 Lessons in Entrepreneurship

As a blogger, I spend most of my time writing. But it’s time spent reading that’s most satisfying. Here’s a short (and by no means a complete) list of 10 articles that encapsulate the art of the startup. Most were published during 2009, and I found them educational and full of practical tips that we’ve applied to our business. They’ve also helped me think differently about startups and entrepreneurship. Hope you enjoy reading them as much as I did.

  1. “What Startups Are Really Like” by Paul Graham: This has to be the single best essay I read during 2009. Every entrepreneur should begin the startup journey with this essay. It bottles every essence of entrepreneurship and startups, and is chock-full of practical advise and tips that are applicable to anyone who dares to dream.
  2. “Milestones to Startup Success” by Sean Ellis: Ellis explains the need for minimum viable product, aka MVP, and then outlines how startups can go up his startup pyramid to find success.
  3. Myth: Entrepreneurship Will Make You Rich” by Eric Ries: “One of the unfortunate side effects of all the publicity and hype surrounding startups is the idea that entrepreneurship is a guaranteed path to fame and riches. It isn’t,” Ries writes in this no-holds-barred essay about the challenges and pitfalls of being a startup founder.
  4. “What Is the Minimum Viable Product?” by Venture Hacks: A great audio conversation on the Venturehacks blog including a slide show.
  5. “The Power of Continuous Improvement” by Mike Speiser: In a guest post for us, Mike talks about the importance of metrics, feedback and how they can drive continuous improvement. Mike’s rules have found eager takers among our team.
  6. “Getting Comfortable With People Who Make You Uncomfortable” by Mike Speiser: In this article, Mike addresses the need for people who challenge conventional wisdom and make everyone around them uncomfortable — which is why every company needs them.
  7. “The Funnel Principle: Software & Making Money” by Tony Wright: It’s good to build great products, but in order to build great companies one needs to have more — a clear path of monetization, an attention magnet, and in general excellence at things beyond product development.
  8. “Does Every Startup Need a Steve Jobs?” by Andrew Chen: A dissection of how insanely great products are built by combining desirability, feasibility and viability. Read this post after reading Wright’s “Funnel Principle.”
  9. “Designing for Social Traction” by Josh Porter

 

10: “Startup Killer: The Cost of Customer Acquisition” by David Skok: A definitive essay on startup business models, the perils of overoptimism, and the importance of cost of customer acquisitions. Skok is a 3-time entrepreneur with a lifetime of experience.

Bonus links:

Steve Jobs\’ 2005 Stanford Commencement Address

 

 

Connecting Red Hat 5.3 to a Dell MD3000i

Connecting to a DELL MD3000i is no trivial matter with Linux. First, you need to ensure that you have the DKMS package installed.

>yum -y install dkms
>yum -y install iscsi-initiator-utils
>yum -y install gcc
>yum -y install kernel-devel
>yum -y install sgpio
>yum -y install sg3_utils

Now you can install the Dell Tools and finish configuring your SAN.

Jasper Server Permission Denied error

Occasionally, Jasper Server has an error relating to being unable to write files. The errors show up in the Apache web server log, catalina.out.

You have probably started the service as the user root on accident. This will cause ownership to change to root on some log files. Then when you log back on as user jasper and restart your server, the Apache logs are filling with messages about not being able to write files. Jasper is just not working properly. Run the following command to restore the proper ownership to all files in the Jasper directory. You must run the following command as root:

>find /home/jasper/jasper-server-3.7 -user root -exec chown jasper.jasper {} \;

This will find all the files that root changed ownership and change the ownership back to the proper jasper user.