<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>VMWare on bramp.net</title>
    <link>https://blog.bramp.net/</link>
    <description>Recent content in VMWare on bramp.net</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-GB</language>
    <lastBuildDate>Fri, 19 Mar 2010 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://blog.bramp.net/tags/vmware/" rel="self" type="application/rss+xml" />
    
    <item>
      <title>VMWare breaks shift key</title>
      <link>https://blog.bramp.net/post/2010/03/19/vmware-breaks-shift-key/</link>
      <pubDate>Fri, 19 Mar 2010 00:00:00 +0000</pubDate>
      
      <guid>https://blog.bramp.net/post/2010/03/19/vmware-breaks-shift-key/</guid>
      <description><p>I came into my office today to find that my keyboard would no longer type capital letters. The shift, caps lock, and even num lock keys seemed to be broken. After a quick WTF <a href="http://www.evolution-systems.co.uk/blogs/matt/view_post&amp;id=37/">it was pointed out to me</a> that VMWare occasionally does this to Linux machines. Thanks to <a href="http://twitter.com/bigkebabman">Matt</a> who showed me a quick solution. In a terminal just type:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">setxkbmap
</span></span></code></pre></div><p>And everything should be back to normal. After using VMWare on Linux for a couple of years I’ve never encountered this problem!</p>
</description>
    </item>
    
    <item>
      <title>linuxoffsets for FreeBSD</title>
      <link>https://blog.bramp.net/post/2009/01/11/linuxoffsets-for-freebsd/</link>
      <pubDate>Sun, 11 Jan 2009 00:00:00 +0000</pubDate>
      
      <guid>https://blog.bramp.net/post/2009/01/11/linuxoffsets-for-freebsd/</guid>
      <description><p>VMWare 6 and above has this neat debugging functionality where you can attach gdb running on a host, to a guest running inside VMWare. This allows you to debug a running kernel, or on linux running processes.</p>
<p>However, VMWare seems to have coded a bit of a hack to allow gdb to understand what process/threads are inside the virtual machine. Now this hack involves using something called linuxoffsets, which provides the offset for certain fields in a linux kernel struct.</p>
<p>So I thought I could abuse these offsets, and hopefully make them work for FreeBSD. The Linux offsets are:</p>















<table class="table">
  <thead>
      <tr>
          <th></th>
          <th>Linux Values</th>
          <th>FreeBSD 7.1 Values</th>
          <th>Notes</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>&lt;version&gt;</td>
          <td></td>
          <td></td>
          <td>Version number of linux kernel, ie 0x020609 (2.6.9)</td>
      </tr>
      <tr>
          <td>&lt;mm&gt;</td>
          <td>task_struct-&gt;mm</td>
          <td></td>
          <td></td>
      </tr>
      <tr>
          <td>&lt;next_task&gt;</td>
          <td>task_struct-&gt;next_task (linux &lt; 2.4.15)</td>
          <td>struct proc-&gt;p_list-&gt;le_next</td>
          <td>Pointer to next task struct</td>
      </tr>
      <tr>
          <td>&lt;tasks&gt;</td>
          <td>task_struct-&gt;tasks (linux &gt;= 2.4.15)</td>
          <td>0</td>
          <td>Pointers to prev and next task struct</td>
      </tr>
      <tr>
          <td>&lt;comm&gt;</td>
          <td>task_struct-&gt;comm</td>
          <td>struct proc-&gt;p_comm</td>
          <td>executable name</td>
      </tr>
      <tr>
          <td>&lt;pid&gt;</td>
          <td>task_struct-&gt;pid</td>
          <td>struct proc-&gt;p_pid</td>
          <td>pid of the process</td>
      </tr>
      <tr>
          <td>&lt;thread&gt;</td>
          <td>task_struct-&gt;thread</td>
          <td></td>
          <td></td>
      </tr>
      <tr>
          <td>&lt;pgd&gt;</td>
          <td>mm_struct-&gt;pgd</td>
          <td></td>
          <td></td>
      </tr>
      <tr>
          <td>&lt;rsp0/esp0&gt;</td>
          <td>thread_struct-&gt;rsp0 (or thread_struct-&gt;esp0 32bit)</td>
          <td>struct thread-&gt;td_sigstk-&gt;ss_sp</td>
          <td></td>
      </tr>
      <tr>
          <td>&lt;fs&gt;</td>
          <td>thread_struct-&gt;fs</td>
          <td></td>
          <td></td>
      </tr>
      <tr>
          <td>&lt;threadsize&gt;</td>
          <td>0x2000 or sizeof(union thread_union-&gt;stack) (linux &gt;= 2.6)</td>
          <td></td>
          <td></td>
      </tr>
      <tr>
          <td>&lt;grouplead&gt;</td>
          <td>task_struct-&gt;group_leader (linux &gt;= 2.6.11)</td>
          <td>0</td>
          <td></td>
      </tr>
      <tr>
          <td>&lt;threadgroup&gt;</td>
          <td>task_struct-&gt;thread_group (linux &gt;= 2.6.11)</td>
          <td>0</td>
          <td></td>
      </tr>
      <tr>
          <td>&lt;commsize&gt;</td>
          <td>sizeof(struct task_struct-&gt;comm)</td>
          <td>sizeof(struct proc-&gt;p_comm)</td>
          <td>executable name’s max len</td>
      </tr>
  </tbody>
</table>

<p>However, after some time I feel this isn’t going to be possible. Each value represents a offset into a Linux task_struct struct, however, nothing represents the location of the first task_struct in RAM. I suspect VMWare is figuring out the location via some other means. Since FreeBSD doesn’t have a task_struct it most likely won’t be able to find what it needs.</p>
<p>Regardless I’ve posted this entry in case someone wants to continue my work. However, not all is lost as my next solution involves playing with gdb-python.</p>
</description>
    </item>
    
  </channel>
</rss>
