{"id":197,"date":"2012-09-24T19:09:23","date_gmt":"2012-09-24T19:09:23","guid":{"rendered":"https:\/\/peterklemperer.com\/blog\/?p=197"},"modified":"2012-09-24T19:09:23","modified_gmt":"2012-09-24T19:09:23","slug":"vmitools-setup-instructions","status":"publish","type":"post","link":"https:\/\/peterklemperer.com\/blog\/2012\/09\/24\/vmitools-setup-instructions\/","title":{"rendered":"vmitools Setup Instructions"},"content":{"rendered":"<p>For my thesis work I study virtualization and I was interested in trying out the <a href=\"http:\/\/code.google.com\/p\/vmitools\/\">vmitools<\/a> project with a Windows 7 guest. Unfortunately I found the installation instructions a little difficult but I eventually muddled my way through. Below are my instructions but comment up if you need any clarifications!<!--more--><\/p>\n<ol>\n<li>Install Ubuntu 12.04.<\/li>\n<li>Install Xen.<br \/>\nThere are very good instructions by David Euler on his tutorial\u00a0<a href=\"http:\/\/www.beyondlinux.com\/2011\/11\/02\/install-xen-4-1-and-setup-your-cloud-os-on-ubuntu-11-10\/\">Setup your cloud server in 3 minutes with Xen 4.1 on Ubuntu 11.10<\/a>.<\/li>\n<li><a href=\"http:\/\/code.google.com\/p\/vmitools\/source\/checkout\">Download and compile vmitools from git<\/a>.<br \/>\nI checked out the version from the git repository as it seemed more current and adequately stable. The installation instructions in the README were mostly correct but I had to install a few extra packages:<br \/>\nsudo apt-get install automake libtool checkThe basic procedure was what you might expect:<br \/>\n.\/autogen.sh<br \/>\n.\/configure<br \/>\nmakeI didn&#8217;t install the tools and this seems fine for now.<\/li>\n<li>\u00a0Create a Xen guest with whatever Windows OS you want.<br \/>\nThe Ubuntu supported Virtual Machine Manager GUI is fantastic and I didn&#8217;t need instructions. I used Windows 7 SP1 and named it win7-i386-xen. This name is important for later so make sure you don&#8217;t use any weird characters that don&#8217;t work easily with your shell.<\/li>\n<li>Collect the configuration constants.<br \/>\nThis is where I was in the weeds for a few whiles. There are many methods for getting the offsets but I found using WinDbg to be the quickest. I would have preferred to use the scripts included in the git repo but I couldn&#8217;t get them to work nearly as fast.<a href=\"http:\/\/msdn.microsoft.com\/en-us\/windows\/hardware\/gg463009.aspx\"><br \/>\nInstall WinDbg using the instructions here<\/a>.Turn on debug in your Windows 7 instance that you installed in step 4. One easy way to do this is to turn on the guest, open a cmd prompt with administrative privileges, and type<\/p>\n<pre>bcdedit \/set debug on<\/pre>\n<p>Then reboot.<\/p>\n<p>Open WinDbg and create a local debug session <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/hardware\/ff553382(v=vs.85).aspx\">as shown here<\/a>. Make sure you open WinDbg with Administrative privileges (on the right click menu) or else this won&#8217;t work!<\/p>\n<p>Configure the WinDbg symbol stores (File-&gt;Symbol File Path), make sure to select reload:<\/p>\n<pre>srv*C:\\symbols*http:\/\/msdl.microsoft.com\/downloads\/symbols<\/pre>\n<p>Dump the EPROCESS table and record the entries for UniqueProcessId and ActiveProcessLinks.<\/p>\n<pre>dt _eprocess<\/pre>\n<p>For me UniqueProcessId was oxb4 and ActiveProcessLinks was 0xb8. Reload the symbol store (!reload) if this doesn&#8217;t work.<\/p>\n<p>Dump the KPROCESS table and record the entry for DirectoryTableBase.<\/p>\n<pre>dt _kprocess<\/pre>\n<p>For me DirectoryTableBase\u00a0was ox18.<\/p>\n<p>Create the configuration file in ~\/etc\/libvmi.conf, substituting my values with the values you just recorded and the name of the vm you created in step 4:<\/p>\n<pre>win7-i386-xen {\r\n    ostype     = \"Windows\";\r\n\u00a0   win_tasks  = 0xb8;\r\n    win_pdbase = 0x18;\r\n    win_pid    = 0xb4;\r\n}<\/pre>\n<\/li>\n<li>Create the libvmi configuration file.<br \/>\nCreate the configuration file in ~\/etc\/libvmi.conf, substituting my values with the values you just recorded and the name of the vm you created in step 4:<\/p>\n<pre>win7-i386-xen {\r\n    ostype     = \"Windows\";\r\n\u00a0   win_tasks  = 0xb8;\r\n    win_pdbase = 0x18;\r\n    win_pid    = 0xb4;\r\n}<\/pre>\n<\/li>\n<li>Test the installation with\u00a0the process list example.<br \/>\ncd your host command line into in the vmitools\/examples directory. Then run:<\/p>\n<pre>sudo .\/process-list win7-i386-xen<\/pre>\n<p>You should get a list of active process id&#8217;s in the guest. You can verify these by opening the Windows Process Explorer (ctrl-alt-delete in the Virtual Machine Manager GUI Send Key menu) and you may need to view-&gt;select columns and select &#8220;pid&#8221; in the Process Explorer.<\/li>\n<\/ol>\n<p>CONGRATULATIONS! If you made it this far you probably deserve a big cup of coffee. I hope that this was helpful. If it was, please let me know below.<\/p>\n<p>Links:<\/p>\n<ul>\n<li><a href=\"http:\/\/code.google.com\/p\/vmitools\/\">vmitools<\/a><\/li>\n<li><a href=\"http:\/\/www.beyondlinux.com\/2011\/11\/02\/install-xen-4-1-and-setup-your-cloud-os-on-ubuntu-11-10\/\">David Euler&#8217;s excellent Xen installation instructions<\/a><\/li>\n<li><a href=\"http:\/\/code.google.com\/p\/vmitools\/source\/checkout\">vmitools google code checkout<\/a><\/li>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/windows\/hardware\/gg463009.aspx\">Windbg installation instructions<\/a><\/li>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/hardware\/ff553382(v=vs.85).aspx\">WinDbg local kernel debug instructions<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>For my thesis work I study virtualization and I was interested in trying out the vmitools project with a Windows 7 guest. Unfortunately I found the installation instructions a little difficult but I eventually muddled my way through. Below are &hellip; <a href=\"https:\/\/peterklemperer.com\/blog\/2012\/09\/24\/vmitools-setup-instructions\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[6],"tags":[42,43,45,44],"class_list":["post-197","post","type-post","status-publish","format-standard","hentry","category-projects","tag-linux","tag-ubuntu","tag-vmitools","tag-xen"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1VqWo-3b","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/posts\/197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/comments?post=197"}],"version-history":[{"count":0,"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/posts\/197\/revisions"}],"wp:attachment":[{"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/media?parent=197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/categories?post=197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/tags?post=197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}