Note :- it requires a jailbroken iPhone.
Step1 :- Set up the iPhone
On your iPhone:
Click Settings ? General and set Auto-lock to Never. This will ensure the iPhone keeps the WiFi connection open.
Click Settings ? WiFi and select your WiFi network. Click the Static button and change the IP Address to something outside the dynamically assigned range of your network. For example, if your wireless router normally assigns 192.168.1.1 -- 192.168.1.5, try 192.168.1.10. This will ensure your iPhone is always contactable at the same address for syncing.
Click on All Packages ? OpenSSH ? Install.
Click All Packages ? BSD Subsystem ? Install
Step2 :- Set up Ubuntu
A third party source provides the ipod convenience package needed to properly mount and unmount an iPhone or iPod Touch, and for gtkpod users, a newer gtkpod that’s required for the iPhone and iPod Touch.
First you need to edit the /etc/apt/sources.list file
sudo gedit /etc/apt/sources.list
add the following line
deb http://ppa.launchpad.net/ipod-touch/ubuntu gutsy main
Save and exit the file
Update the source list
sudo aptitude update
Install the ipod-convenience and amarok packages
sudo aptitude install ipod-convenience amarok
When asked, enter the IP address of your iPod Touch or iPhone that you selected earlier. When asked for a folder to mount your iPod Touch or iPhone, either leave the default of /media/ipod or another folder if you prefer -- just remember to use that folder name for rest of this guide. The package will make the folder for you.
Step3 :- Set up Amarok
Click Applications ? Sound and Video ? Amarok
When you first open up Amarok:
Click Settings ? Configure Amarok.
Choose Media Devices.
Hit Add Device.
Select Apple iPod Media Device for the plugin type.
Point it at your mount point, /media/ipod.
Back in the main app, click the blue cog icon called Configure Device just above the iPhone or iPod Touch. For Pre-Connect Command, add iphone-mount, for the Post-Disconnect Command, add iphone-umount
Click Connect. After entering your password, your iPhone or iPod touch should now appear in Amarok.
You can now add, edit, and delete music to the iPhone like any other device. Just drag the music files into Amarok, and hit Transfer to move them to your iPhone. When you’re done, stop any music playing from the iPhone and click Disconnect.
Music should show now up in the iPhone immediately.
Note: If music doesn’t show up immediately this may be due to a bug recent BSD Subsystem packages missing the killall command. If so, you can download killall for iPhone, move the ‘killall’ file to /usr/bin/on your iPhone, and enable the execute permission.