Friday, 17 June 2011

Starting slax os in virtual box using VBoxManage commandline.

hi,

Today i was told to study the virtual box command line functions. I studied a little bit.

And i thought its time to try and start a VM( Virtual Machine ) through command line.

I hope you already installed Virtual box in your system.

This is just a basic setup for a os. so there is only 7 commands to start a VM.

So lets get started,.....

open terminal...

First command  : To create a VM.
   $VBoxManage createvm --name "slax try" --ostype Linux --register



This first command tells the virtual box to create a VM named "slax try", then ostype. slax is a linux based os  so "Linux"( make sure L is caps otherwise Vbox will bang you with error). register helps to register the created VM with Vbox.

Second command  : To add memory and other essential things to VM.
    $VBoxManage modifyvm "slax try" --memory 512 --acpi on --nic1 nat
--audio pulse --audiocontroller ac97



This command modifies the "slax try" VM with 512 MB RAM, enabling ACPI, NAT ,pulse audio and its controller.

Third command : creating hard disk for VM.
    $VBoxManage createhd --filename "slaxhd.vdi" --size 3072



The third command used to create a file which will act as a hard disk for created "slax try" VM. You have to give a name for the hard disk file with .vdi extension. then specify how much space you wanna allocate for the had disk( in MB).

Fourth command : creating storage controller.
   $VBoxManage storagectl "slax try" --name "IDE Controller" --add ide
--controller PIIX4



This command helps to name the controller and add ide and its controller to VM.

Fifth command : attaching Hard Disk storage to storage controller.
    $VBoxManage storageattach "slax try" --storagectl "IDE Controller"
--port 0 --device 0 --type hdd --medium "slaxhd.vdi"



This command attaches the storage controller to the VM hard disk.

Sixth command :  attaching dvddrive to storage controller.
    $VBoxManage storageattach "slax try" --storagectl "IDE Controller"
--port 0 --device 1 --type dvddrive --medium
/media/7AD4E860D4E8205D/zen/slax-6.1.2.iso

Seventh ( last )  command: starting the created VM.
       $VBoxManage startvm "slax try" --type gui



Have fun :)

Wednesday, 15 June 2011

Installing virtualbox in fedora 14.

hi,

Today i installed virtualbox in my system, in gui mode its very simple and easy.

http://www.virtualbox.org/wiki/Linux_Downloads

get virtualbox software in the above mentioned link.

if your system is 32 bit then click on i386.

if 64bit then click AMD64.

on clicking you will be prompted to open or save the file. just save the file.

then after downloading, goto where it is downloaded there will be an rpm file.

just right click on it click on 'open with package installer' .

you will see a screen like this.

then you will be prompted with some dependencies and authentication popups just continue.

after installation has finished.

goto "Applications>>System Tools>>Oracle VM VirtualBox"

the installed virtual box will be started now, so you will see a screen like this...

Installing ubuntu inside virtualbox in fedora 14.

hi,

Today i installed virtualbox in my system, in gui mode its very simple and easy.

http://www.virtualbox.org/wiki/Linux_Downloads

get virtualbox software in the above mentioned link.

if your system is 32 bit then click on i386.

if 64bit then click AMD64.

on clicking you will be prompted to open or save the file. just save the file.

then after downloading, goto where it is downloaded there will be an rpm file.

just right click on it click on 'open with package installer' .

you will see a screen like this.



then you will be prompted with some dependencies and authentication popups just continue.




after installation has finished.

goto "Applications>>System Tools>>Oracle VM VirtualBox"

the installed virtual box will be started now, so you will see a screen like this...



now we have to create a vitual machine. so click on 'New' icon.

you will see a popup window like this,



click on next

you will see a popup which asks for name and os and its version.

just add the specification of what you going to install in your VM(Virtual Machine).

I installed ubuntu 10.10. So i gave name as ubuntu 10, OS as Linux then version as ubuntu.



then click next.

In this popup you have to allocate a specific RAM for your VM. since i have a 2GB RAM, i gave 512 MB for VM.



them click next.

Now you have to allocate a space in your system which will act as a hard disk for your VM. so i gave 'create new hard disk'



then click next.

In the next window you have to select either dynamic or fixed type of storage for your hard disk(or file whatever...).

i suggest dynamic.



after selecting the choice click next.

give the location and size for the virtual hard disk that is to be created.



then click next.

the window will ask for the confirmation.



click next.

then you will be asked for another confirmation for creating the virtual machine.

click next.

thats it you created a virtul machine, well done.



then we have to install ubuntu 10 in vitual machine.

todo that we have tell it to boot from cdrom.

just click on 'settings'  ,you will see a popup box like this,



in it see the left menu.

click on 'storage' you will see this.....



sorry i took a screen shot of my slax os. but the steps are the same.

click on  'filename.iso'. here 'slax-6.1.0.iso'.

you will see like this.



click on the icon which my mouse cursor is pointing to and then give the path of the ubuntu.iso file to it(make sure that iso file is bootable.).

then click ok.

thats it well done... now start the system by clicking green 'start' button.

you will see a screen with ubuntu booting in it. congrats :)

have fun :)

Saturday, 4 June 2011

how to start a program right after a user login?

hi,

Today i learnt how to start a program right after a user logged in.

its really simple...

just goto system>>preferences>>start up applications

you will see a pop up box like this



now click on 'Add'

you will see another pop up like this...



then click on 'Browse', add specify the program which you wanna use on start up.

you can name the program and also add some comment for it.

then click 'Add'

thats it now log out and login

have fun :)

Friday, 3 June 2011

How to run something when the computer starts?

hi,

Today i learnt how to run a command right after you boot, before anybody logs in.

To do that we have to edit a file which is in  /etc the file is rc.local

first  Open a terminal  then Become root using  su - 

then open the file in your favorite text editor.

i have  used gedit /etc/rc.local &

then add the command that you want to run to the end of the file.

then reboot the system.

have fun :)

Python program which finds the numbers in a given string using regular expression

hi,

Today i was seeing regular expression in python. I just read some regexp funtions so thought to write a program which gives a list of numbers from a given string.

the code is given below...

#! usr/bin/env python
import re
string1 = raw_input("enter the text from which you wanna get only numbers: ")
numlist = re.compile('\d+').findall(string1)
print numlist

i/p:

enter the text from which you wanna get only numbers : hello123 rte34d 5b6b7b 12.03

o/p:

[ '123', '34', '5', '6', '7', '12', '03' ]

Note: it does not support floating point numbers eg:'12.01' is taken as '12','01'