LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices

Reply
 
LinkBack Search this Thread
Old 05-19-2012, 06:17 AM   #1
dazdaz
Member
 
Registered: Aug 2003
Location: Europe
Distribution: RHEL 6.x, 5.x, Fedora 20, Kubuntu 12.04, Solaris 10,8
Posts: 321

Rep: Reputation: 17
Accessing /proc from inside a VM


I have access to a Linux virtual machine (KVM).

Is there any way or method of accessing /proc inside the virtual server ? I think that the virtualisation layer gets in the way...

Would be greatful for any pointers.
 
Old 05-19-2012, 09:45 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,821

Rep: Reputation: Disabled
Do you want to access the /proc filesystem on the hypervisor host from the VM, or the other way around? What is it that you want to accomplish?

/proc is a virtual filesystem representing system resources, and the elements in it can be accessed like ordinary files and directories from within that system.
 
Old 05-19-2012, 09:59 AM   #3
dazdaz
Member
 
Registered: Aug 2003
Location: Europe
Distribution: RHEL 6.x, 5.x, Fedora 20, Kubuntu 12.04, Solaris 10,8
Posts: 321

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by Ser Olmy View Post
Do you want to access the /proc filesystem on the hypervisor host from the VM, or the other way around? What is it that you want to accomplish?
Hi, I want to access /proc from within the VM. I don't have access to the hypervisor host.

I am using the KVM VM as a development platform to write some scripts which need to access /proc but these scripts will be run on VMware VM's or directly on bare metal Linux boxes.

Quote:
/proc is a virtual filesystem representing system resources, and the elements in it can be accessed like ordinary files and directories from within that system.
Correct.

I presume that /sys using sysfs also can't be accessed. I think I am chasing a ghost here, what I want to do, does not seem possible.
 
Old 05-19-2012, 10:16 AM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,821

Rep: Reputation: Disabled
Quote:
Originally Posted by dazdaz View Post
Hi, I want to access /proc from within the VM. I don't have access to the hypervisor host.
You can access /proc on the VM, but not /proc on a different host (at least not directly).

Quote:
Originally Posted by dazdaz View Post
I am using the KVM VM as a development platform to write some scripts which need to access /proc but these scripts will be run on VMware VM's or directly on bare metal Linux boxes.
If I understand you correctly, you want to test your scripts against the /proc entries on a hypervisor similar to the one they will actually be running on.

The problem is that not only can you not access the /proc filesystem of the hypervisor (or any other system) from within the VM, but the hypervisor environment is different from that of the hypervisor your scripts will be running on. Unless you're accessing both VMware and KVM through middleware like libvirt, it's unlikely that testing in a KVM environment will help. And if you are using libvirt, accessing /proc directly shouldn't really be necessary.

Why don't you get a free version of ESXi to test your scripts against? Or, if testing under KVM really is sufficient, use nested virtualization? (Yes, that actually works.)
 
1 members found this post helpful.
Old 05-20-2012, 11:46 AM   #5
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 808

Rep: Reputation: 87
if you need to access a filesystem on the hypervisor rfom within a VM, the only way to do that is by running whatever commands you need to remotely. Same as you would execute commands on a remote host. I usually use ssh for that.

VMs should NOT and canNOT access the hypervisor, that's the whole idea, and if they can, it's a major security breach and not a feature.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Other stuff accessing data from inside my Gmail! resetreset Programming 14 01-12-2011 10:16 PM
tcl/tk $env(HOME) not found inside proc sharky Programming 1 06-01-2008 02:39 PM
segmentation fault when accessing /proc/ioports uselpa Slackware 2 01-05-2006 05:03 AM
accessing variables inside a function bahadur Programming 1 03-27-2005 04:41 AM
accessing /proc from within chroot environment JustinHoMi Linux - Security 7 06-06-2003 03:48 PM


All times are GMT -5. The time now is 10:11 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration