Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Saturday, December 6, 2008

Fullscreen of Fedora10 installed on Vista using VirtualBox

Installing Fedora10 on Windows Vista using Virtual Box was very straight forward. I used a live disk or the iso initially and once the virtual machine booted up, I used the option of install to hard disk to avoid using the iso or the Live CD. The complex issue was that the screen size is too small i.e. the highest available resolution was 800 x 600. My Vista is using 1280 x 800, hence the Fedora on Virtual Box looked very small. I was able to make it full screen by following certain steps mentioned as below:
  • Run the Virtual Machine installed using VirtualBox. Go to the Devices menu and select the "Install Guest Addons . . ." option. Reboot the machine.
  • When the virtual machine is shutdown, you should be able to see that in the settings "CD/DVD-ROM" section will be configured for the "VBoxGuestAdditions.iso".
  • On the Virtual Machine startup, you shall be able to see this iso mounted and have icon on the desktop.
  • Before these Addons can be installed certain dependencies like make, gcc, kernel-headers and kernel-devel needs to be installed. These can be done using the following commands:
      • #] yum install make
      • #] yum install gcc-c++
      • #] yum install kernel-headers
      • #] yum install kernel-devel
  • When the dependencies are installed, we proceed installing the addons
      • #] cd /media/VBOXADDITIONS_2.0.6-39755/
      • #] sh ./VBoxLinuxAdditions-x86.run
  • Reboot the Virtual Machine. Now fire the commands to get the Display in the System > Administration menu.
      • #] yum install system-config-display
  • Now you can open the System > Administration > Display window. In the Hardware tab, select the VBoxVideo drivers in the Video Card configuration. Press OK two times and reboot the machine.
  • On restart, again open the Display window. If the desired resolution is not being displayed then you have to manually modify the /etc/X11/xorg.conf file.
  • Open the /etc/X11/xorg.conf file . Modify the Section "Screen". You need to add the Modes.
  •       Section "Screen"
             Identifier "Screen0"
             Device     "Videocard0"
             Monitor    "Monitor0"
             DefaultDepth     24
             SubSection "Display"
                 Viewport   0 0
                 Depth     24
                 Modes "1024x768"
             EndSubSection
          EndSection
  • Reboot the machine. On restart, you shall see the Virtual Machine will start with the new resolution. To have full screen press the host + F keys. By default the host key for Virtual Box is Right Control key.

Monday, September 8, 2008

Setting network b/w Linux machines using USB cable

To setup the USB network between two linux machines perform the following steps :- 1) Attach both the Linux machines using a USB cable. 2) Open the terminal window on each of the machines and type the following command (On first machine) ]# ifconfig usb0 10.100.10.101 netmask 255.255.255.0 (On second machine) ]# ifconfig usb0 10.100.10.102 netmask 255.255.255.0 Once done, try to ping the other machine using the assigned ip i.e. 10.100.10.101. This technique has been tested with two machines with Fedora 9 on one machine and busybox on other. It should be able to work on other combinations of linux too.

Sunday, September 7, 2008

Java Socket client issue on Linux

In the case that the socket client is on the windows and server on linux & the server goes down, the client on windows identified immediately and gives an exception. For a scenario vice versa i.e. socket client on linux and server on any other machine (currently tested on windows), the client waits for too long for a timeout. To deal this situation instead of opening a socket client like:
 Socket socket = new Socket(“10.1.25.186”, 8080);
You should use:
InetAddress inetAddr = InetAddress.getByName(“navnit.tempo.local”);  
SocketAddress socAddr = new InetSocketAddress(inetAddr, 8080);  
Socket socket = new Socket();  socket.connect(socAddr, 5000); // 5000 is the timeout in millis.