File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes How to know the linux is running on a virtual server? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "How to know the linux is running on a virtual server?" Watch "How to know the linux is running on a virtual server?" New topic
Author

How to know the linux is running on a virtual server?

Sky Loi
Ranch Hand

Joined: Oct 06, 2008
Posts: 65
I have a remote linux server. What commands I could use to check if the linux is running on a virtual server? And the system resource allocation info for the virtual servers?

Thank you
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Try:

uname -a

JBoss In Action
Sky Loi
Ranch Hand

Joined: Oct 06, 2008
Posts: 65
I tried it and it shows following:
Linux server-name 2.6.18-128.1.6.el5 #1 SMP Wed Apr 1 09:19:18 EDT 2009 i686 i686 i386 GNU/Linux

How can I see it is in VM or physical?

Thank you
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15958
    
  19

The whole point of a virtual machine is to make it as difficult as possible to distinguish between it and a real physical machine.

You may be able to see some differences in the DMESG boot report, since often the hardware virtualization isn't complete. Some things aren't actually necessary for each individual VM and can be handle by the VM host. Also, depending on the virtualization method used, there may be vm-assist packages installed, although that doesn't necessarily indicate that the machine is currently running virtualized. Other cues include doing an "ifconfig" and looking for virtual NICs.

Finally, a VM often shows less RAM and disk than a full physical machine, since you're usually using it for a specialized purpose and therefore don't need worst-case hardware. Instead you share the resources among VMs.


Customer surveys are for companies who didn't pay proper attention to begin with.
Sky Loi
Ranch Hand

Joined: Oct 06, 2008
Posts: 65
Thanks for all replies. They are really helpful to me.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to know the linux is running on a virtual server?
 
Similar Threads
Running linux(CentOS) as virtual server on Windows 2003 server?
unable to communicate over virtual LAN using Java IDL
VMWare
Suddenly getting java.lang.NoClassDefFoundError
virtual dedicated server Linux - How can install each (Tomcat, JDK)