Showing posts with label english. Show all posts
Showing posts with label english. Show all posts

Wednesday, March 02, 2011

Resizing VirtualBox Virtual Hard Disk (vdi image)

بسم الله الرحمن الرحيم


Assalamualaikum WBT. Today I stumbled upon my VirtualBox hard disk problem. I wanted to install Adobe Photoshop CS5 however, the space available was too small for the disk hogged software. I googled around and luckily found a blog as if it was created to solve my not so little problem. Here is the exact url http://www.modhul.com/2008/10/21/re-sizing-a-virtualbox-virtual-disk-image-file/. I will try to make it easier to understand. I am using Crunchbang linux (Statler) as the host and a closed source VirtualBox (I need USB support).


What You Need?
  1. Shut down the Virtual Box that uses the disk you want to resize.
  2. Remove any snapshots you have.
  3. Backup your vdi image (the VirtualBox hard disk).
  4. Download GParted LiveCD iso here.
  5. Create a new larger disk (according to size that you need).
  6. Attach the new created disk to your VirtualBox as slave.
  7. Mount the GParted iso to your VirtualBox.

Next Steps
  • Boot the virtual machine from the mounted ISO – you may need to reconfigure your VirtualBox to ensure that you boot from the CD-ROM drive before the HDD, so change the VirtualBox settings as shown below or hit F12 at boot and change there.

  • During the boot process the gparted Live CD will prompt you to select the correct keymap – if you are using a QWERTY keyboard, simple select the ‘Don’t Touch Kepmap’ option; next, you will be prompted for the language settings to be used – select the appropriate language code, in my case ’02′ for British English; finally, you will be prompted for the X-Windows mode – select ’0′ to automagically start gparted in an X-Windows session.

  • Once gparted starts, you will be presented with a graphical representation of your disks – left-click the left-to-right bar named /dev/sda1 (your primary hard disk that is to be expanded) and then click on the Copy icon.

  • Select the drop-down-box to the right of the tool-bar and select the second (currently empty) disk – /dev/sdb (possibly /dev/hdb in your environment), the graphical representation of your disks will change to show you the second slave disk which is currently empty. Click on the Paste icon.

  • gparted will will prompt you that all data on the new partition will be erased and if you’re happy, subsequently prompt you on how the disk should be formatted. For a Windows environment, select MSDOS (this will give you an NTFS partition, trust me!).

  • gparted will finally present you with a slider dialog indicating the desired size of the new disk. Drag the slider to the right to select the maximum size of the new partition on this new disk (I’d just drag it so the partition consumes the whole disk), as shown in the screenshot below:


  • Click the Apply icon, you’ll be presented with something along the lines of the screenshot below as the contents of the source disk are copied to the new, larger, disk:
  • Once the copy has completed (approx. 35 mins to create a 30Gb disk from an original 20Gb disk), you will need to mark the new disk as bootable (if this is to be a bootable partition – if not, simply skip the next step).

  • To mark the partition as bootable, right-click the graphical representation of the new disk and left-click Manage Flags. In the dialog that appears, select Boot and click Ok to close. gparted will apply the necessary flag and re-scan your disks.

  • Close gparted and click the Exit icon to shutdown the system.

Completing the Re-Sizing
  • Once the virtual machine has powered off, re-configure the hard disks to use the newly created/copied disk as the primary and remove the old primary disk from the system; finally, unmount the System Rescue ISO from the CD-ROM.

  • Power on your new VM and you should be presented with the the usual Windows boot sequence; if you are just presented with a black screen with a flashing cursor at the top left-hand corner of the screen, there isn’t a boot sector on the disk, so restart gparted and add the boot flag as directed above.

  • Hopefully, your virtual machine will start without issue. Windows may perform a check of the disk during boot. Once logged-in, open Windows Explorer and confirm that the newly created drive is the new larger size.

Saturday, February 26, 2011

Crunchbang : Perfect Audio in Alienware m11X with OSS

بسم الله الرحمن الرحيم



Assalamualaikum WBT. I have been trying to get my sound works simultaneously on this lappy for a few days now until I recently discovered someone said OSS is better than anything else in comparison of sound quality.


I tried ALSA, compiled from scratch with the latest build but I couldn't get it to play many sounds together simultaneously, let say listening to music and playing game at the same time. I also got my hands into PulseAudio even though the majority in Crunchbang community pretty much hate PA. Now, I know why they want to ban PA so much. I tested PA with YouTube, the video lags with no sound at all until I killed the PA server.

I never thought of trying OSS until today and I glad that I found Martin Baselier's blog about changing alsa to OSS4. Once OSS is installed, my audio works like charm. I got simultaneous audio and awesome and crisp quality out of it. However, I lost my volume system tray icon. Crunchbang uses volumeicon (Maato) by default. I ran volumeicon manually and got this error

~$ volumeicon volumeicon: mixer.c:905: snd_mixer_elem_set_callback: Assertion `mixer' failed. Aborted

In Crunchbang forum, the solution is to remove the ~/.config/volumeicon/volumeicon settings file which resulting to this error instead for me.

volumeicon: asound.c:54: asound_get_volume: Assertion `m_elem != ((void *)0)' failed. Aborted

Then I looked into the official site of volumeicon by Matoo. The solution for me was to remove the default volumeicon using sudo apt-get remove volumeicon and reinstall it from source with enable OSS option.

This is how I did it :

1. Download the source from Matoo website.

2. Extract, and install volumeicon from source with --oss-enable option.

./configure --prefix=/usr --oss-enable 
make
sudo make install

3. Taraaa ~~~ You got your volumeicon back.

Thank You to all the contributors of OSS, Volume Icon and Crunchbang #! community!