Monday, March 29, 2010

Install WINE in Ubuntu 9-10 Desktop for run Windows Application

I install WINE in my Ubuntu 9.10 desktop PC.
This was my memo and works fine for me. If you use this memo for your PC, then remember that I not responsible for if you loss your any kind of data. 

Install WINE in ubuntu for run Windows Application:
$ sudo apt-get install wine
-------------------------------------------
Remove WINE:
$ sudo apt-get remove --purge wine
$ rm -rf ~/.wine
-------------------------------------------
Configuration of the WINE:
winecfg
-------------------------------------------
Installing Windows Applications Using Wine

   To install Windows applications using Wine, follow these instructions:
   1. Download the Windows application from any source (e.g. download.com). Download the .EXE (executable).
   2. Place it in a convenient directory (e.g. the desktop, or home folder).
   3. Open the terminal, and cd into the directory where the .EXE is located.
   4. Type wine the-name-of-the-application.extension (e.g. wine realplayer.exe).

This will start the .EXE using Wine. If it is an installer, it should then run as it would in Windows. If the application asks for a directory to install the application to, select put it under C:\Program Files.

   Download Windows Application:(In my case I install following application.)
   [ Firefox Setup 3.6.2.exe ]
   [ IE7-WindowsXP-x86-jpn.exe ]
   [ VeohWebPlayerSetup_eng.exe ]
   [ install_flash_player.exe ]
-------------------------------------------
Uninstalling Wine Applications

Open up a terminal window and type "uninstaller" - this will open up a program similar to Windows' "add/remove programs" control panel, allowing you to uninstall applications from a Wine installation. Running uninstall programs directly via Wine should also work normally. Alternatively, you could also simply delete the folder of the application. However, as when done in Windows, this method will be "unclean" and will not remove the program's configuration from the Wine registry like using an uninstaller will. If the command "uninstaller" results in an error message try the "wine uninstaller" command.
-------------------------------------------
Adding CD and DVD drives to WINE:
Go to the drives tab in winecfg. Hit the Autodetect button.
If you find that this does not work correctly for you, then follow these instructions:

   1. Run winecfg
   2. Navigate to the drives tab
   3. Click on Add...
   4. In the path bar, type /media/cdrom
   5. Click Show Advanced button below the Browse... button and set the Type to CD-ROM
   6. Click OK
-------------------------------------------
How to make sure the program runs properly:
$ wine "C:\PATHTOPROGRAM\Program.exe"  in the command line.
eg:
$ wine "C:\Program Files\World of Warcraft\WoW.exe")
-------------------------------------------
Changing application specific settings

   1. Type winecfg at the command line
   2. Click on Add Application...
   3. Navigate to where the exe is and choose that program
   4. The dropdown at the bottom allows you to choose which version of Windows Wine should emulate. Also, any changes to the Libraries and Graphics tabs will only affect the chosen application in the Applications tab.
-------------------------------------------
Using Windows Themes/Skins In Wine:
  Color Scheme
  You can change the wine color scheme to closely match the default Ubuntu colors
  $ gedit ~/.wine/user.reg

  You may also want to create a backup copy in your Home folder
  cp ~/.wine/user.reg ~/

  Replace the [Control Panel\\Colors] section with
      [Control Panel\\Colors] 1176981676
    "ActiveBorder"="239 235 231"
    "ActiveTitle"="203 133 61"
    "AppWorkSpace"="198 198 191"
    "Background"="93 77 52"
    "ButtonAlternativeFace"="200 0 0"
    "ButtonDkShadow"="85 85 82"
    "ButtonFace"="239 235 231"
    "ButtonHilight"="255 255 255"
    "ButtonLight"="255 255 255"
    "ButtonShadow"="198 198 191"
    "ButtonText"="0 0 0"
    "GradientActiveTitle"="239 235 231"
    "GradientInactiveTitle"="239 235 231"
    "GrayText"="198 198 191"
    "Hilight"="246 200 129"
    "HilightText"="0 0 0"
    "InactiveBorder"="239 235 231"
    "InactiveTitle"="239 235 231"
    "InactiveTitleText"="255 255 255"
    "InfoText"="0 0 0"
    "InfoWindow"="255 255 166"
    "Menu"="239 235 231"
    "MenuBar"="239 235 231"
    "MenuHilight"="246 200 129"
    "MenuText"="0 0 0"
    "Scrollbar"="239 235 231"
    "TitleText"="255 255 255"
    "Window"="255 255 255"
    "WindowFrame"="0 0 0"
    "WindowText"="0 0 0"
-------------------------------------------
Fullscreen issues with overlapping Panel:

Sometimes the Panel overlaps your fullscreen application you're running in wine. If you are running Visual Effects, the first solution you should try is to turn those off: Go to System -> Preferences -> Appearance, and click the Visual Effects tab. Select None, and your screen will flash. Try your full-screen application again. You may re-enable Visual Effects afterwards - just don't forget to turn them back off when you want to run that application again!

If that does not work, then you will have to turn off the panels prior to running the application and restarting it afterwards, until a better workaround can be found. In Ubuntu the commands are gnome-session-remove gnome-panel and gnome-panel & respectively. In Xubuntu I understand they are killall xfce4-panel and xfce4-panel.

Sunday, March 21, 2010

Ubuntu 9.10 (Desktop) Command Prectice

Ubuntu 9.10 (Desktop) Command Prectice
Installing VMware Player on Ubuntu 9.10:
$ sudo aptitude install build-essential linux-kernel-headers linux-kernel-devel
$ gksudo bash ./<VMware-Player-2.5.1-126130.i386.bundle>
Installing VMware Player on Ubuntu 9.10
1. Install required packages build-essential and linux-headers
      $ sudo aptitude install build-essential linux-headers-`uname -r`

2. Download the latest(http://downloads.vmware.com/d/info/desktop_downloads/vmware_player/3_0) VMware player e.g. VMware-Player-2.5.2-156735.i386.bundle (download the bundle version, not the rpm one) and run it as root using gksudo. You'll get a graphical installer that installs VMware player for you.
      $ gksudo bash ./VMware-Player-3.0.1-227600.i386.bundle

If nothing appears, you may need to make the file executable. You can do so with this command: $ chmod +x ./VMware-Player-3.0.1-227600.i386.bundle

After completion, VMware player is installed and should show up in the menu under Applications → System Tools → VMware Player.

Installing VMware WorkStation on Ubuntu 9.10:
$ sudo aptitude install build-essential linux-kernel-headers linux-kernel-devel
$ gksudo bash ./VMware-Workstation-Full-7.0.0-203739.i386.bundle

Uninstalling VMware WorkStation on Ubuntu 9.10:
$ gksudo bash ./VMware-Player-2.5.1-126130.i386.bundle

Flash player install:
$ sudo apt-get install flashplugin-nonfree

Java Install:

$ sudo aptitude install sun-java6-jdk
$ aptitude search sun-java

Eclipse Install:

$ apt-get install eclipse

Shutdown Ubuntu Server:

$ sudo shutdown -h now
$ sudo shutdown -h 0
$ sudo shutdown -h 18:45 "Server is going down for maintenance"
$ sudo halt
$ sudo poweroff
$ sudo reboot
$ sudo shutdown -r 0

Change IP address:

$ sudo vi /etc/network/interfaces

auto eth0
iface eth0 inet dhcp

auto eth0
iface eth0 inet static
        address 192.168.0.100
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.1

$ sudo vi /etc/resolv.conf
$ sudo apt-get remove dhcp-client
$ sudo /etc/init.d/networking restart

Change the sudo password:

$ sudo passwd
enter new password:
repeat new password again:

Change Hostname:

$ sudo hostname <NEW HOSTNAME>
$ hostname

Install Open SSH:

$ sudo apt-get update
$ sudo apt-get install openssh-server
$ sudo vi /etc/ssh/sshd_config


   LogLevel INFO        # 詳細に取りたい場合はDEBUG
   UsePrivilegeSeparation yes
   Protocol 2
   PermitRootLogin no      # またはwithout-password
   StrictModes yes
   VerifyReverseMapping yes   # ホスト名が逆引きできるか確認します()
   AllowTcpForwarding no    # forwardがいらない場合
   X11Forwarding no       # forwardがいらない場合
   IgnoreRhosts yes
   HostbasedAuthentication no
   RhostsAuthentication no
   RhostsRSAAuthentication no
   AllowGroups admin      # ログインはadminグループ(sudoの可能な人)のみ

$ sudo /etc/init.d/ssh reload

Create Private Key:(If you need private key)$ ssh-keygen
$ chmod 700 ~/.ssh
$ cd ~/.ssh/
$ cat id_rsa.pub >> ~/.ssh/authorized_keys
$ chmod 600 ~/.ssh/authorized_keys
$ rm id_rsa.pub

$ sudo vi /etc/ssh/sshd_config
   ChallengeResponseAuthentication no
   PasswordAuthentication no
   UsePAM no
$ sudo invoke-rc.d ssh reload 

Remove Directory:

$ rm -r directory

Delete User:

$ sudo userdel -r <username>

Show IP Address:

$ /sbin/ifconfig
$ ifconfig

VI Editor:

:w! → Save
dd → Delete one line
xx →Delete Letter
i → Insert Mode
/ → Find

How to install [.deb] package:
$ sudo dpkg -i <install package or .deb file>
$ sudo dpkg -r <remove package name>