Oracle VM VirtualBox: Ticket #9952: Apache in guest cannot access files though shared folderhttps://www.virtualbox.org/ticket/9952
<p>
Symptom is that Apache running in the guest (Ubuntu LTS server) is unable to serve files stored in the host in a shared folder. Strange thing is that the files on the guest are accessible though the shared folder using a shell (user can copy or view files) and also Apache is able to display a directory listing of the files, but when a user clicks on a file in the listing, then the file appears to be served (downloaded to the user), but there is no content (zero bytes). Also, when this happens errors like the following appear in /var/log/messages:
</p>
<pre class="wiki">Nov 22 23:08:25 crcns kernel: [ 8082.266785] VbglR0HGCMInternalCall: vbglR0HGCMInternalPreprocessCall failed. rc=-2
Nov 22 23:08:25 crcns kernel: [ 8082.266902] VBoxGuestCommonIOCtl: HGCM_CALL: 64 Failed. rc=-2.
</pre><p>
And errors like the following appear in VBox.log:
</p>
<pre class="wiki">02:04:21.031 Guest Log: VbglR0HGCMInternalCall: vbglR0HGCMInternalPreprocessCall failed. rc=-2
02:04:21.031 Guest Log: VBoxGuestCommonIOCtl: HGCM_CALL: 64 Failed. rc=-2.
</pre><p>
This problem came up after I upgraded to <a class="wiki" href="https://www.virtualbox.org/wiki/VirtualBox">VirtualBox</a> 4.1.6 (and the guest additions in the guest OS) and also upgraded my host OS (Snow Leopard Server) to 10.6.8. Guest is running Linux kernel 2.6.24-29-virtual, same problem with 2.6.24-30-virtual kernel. This was not a problem before I did the upgrades. Previously, I was using a VB that was a bit out of date, so I'm not sure when this problem was introduced, or if it is being caused by the newer version of OS X server. It does not seem to be a problem on the regular (not a server) OS X version 10.6.7.
</p>
en-usOracle VM VirtualBox/graphics/vbox_logo2_gradient.pnghttps://www.virtualbox.org/ticket/9952
Trac 0.12jefftFri, 25 Nov 2011 23:52:56 GMTattachment sethttps://www.virtualbox.org/ticket/9952
https://www.virtualbox.org/ticket/9952
<ul>
<li><strong>attachment</strong>
set to <em>VBox.log</em>
</li>
</ul>
TicketmichaelMon, 28 Nov 2011 09:09:56 GMThttps://www.virtualbox.org/ticket/9952#comment:1
https://www.virtualbox.org/ticket/9952#comment:1
<p>
If you have a chance to try to narrow that down a bit by trying out older Guest Additions versions from <a class="ext-link" href="http://download.virtualbox.org/virtualbox/"><span class="icon"> </span>http://download.virtualbox.org/virtualbox/</a> that would be great. (Assuming of course that this is an Additions issue.) Old Additions versions should work fine in current <a class="wiki" href="https://www.virtualbox.org/wiki/VirtualBox">VirtualBox</a> versions. An strace of the Apache process might also be interesting if we are able to match the strace output with the log messages (timestamps might help here).
</p>
TicketjefftTue, 29 Nov 2011 22:10:10 GMTattachment sethttps://www.virtualbox.org/ticket/9952
https://www.virtualbox.org/ticket/9952
<ul>
<li><strong>attachment</strong>
set to <em>strace-4_1_6.txt</em>
</li>
</ul>
<p>
Strace output of Apache process, with 4.1.6 guest additions, and matching var/log/messages
</p>
TicketjefftTue, 29 Nov 2011 22:14:04 GMThttps://www.virtualbox.org/ticket/9952#comment:2
https://www.virtualbox.org/ticket/9952#comment:2
<p>
I added strace output of Apache and corresponding log messages. I will try older Guest Additions and get back about that.
</p>
TicketjefftThu, 01 Dec 2011 01:07:29 GMTattachment sethttps://www.virtualbox.org/ticket/9952
https://www.virtualbox.org/ticket/9952
<ul>
<li><strong>attachment</strong>
set to <em>vbox-GA412.log</em>
</li>
</ul>
<p>
VBox.log file for Guest Additions 4.1.2
</p>
TicketjefftThu, 01 Dec 2011 01:12:10 GMTattachment sethttps://www.virtualbox.org/ticket/9952
https://www.virtualbox.org/ticket/9952
<ul>
<li><strong>attachment</strong>
set to <em>strace_GA412.txt</em>
</li>
</ul>
<p>
strace of apache2 with Guest Additions 4.1.2
</p>
TicketjefftThu, 01 Dec 2011 01:56:40 GMThttps://www.virtualbox.org/ticket/9952#comment:3
https://www.virtualbox.org/ticket/9952#comment:3
<p>
The problem still occurs with Guest Additions 4.1.2. I think I was running that version of VB before with no problems. So maybe the error is in general Virtual Box (not the Guest Additions) and/or it was caused by upgrading the host OS to Snow Leopard Server 10.6.8.
</p>
<p>
I uploaded three new files for this GA 4.1.2 test. /var/log/messages of a full system startup until the errors generated by apache, the strace apache2 output, and the VBox.log file. I used syslog-ng to generate microsecond timestamps in /var/log/messages that can be matched with the strace output.
</p>
<p>
Based on the matching, I think the error is in a call to sendfile (generates a Protocol error). In the following (from strace) the file referenced in the first line (crcns-neuroinformatics-article.pdf) is the file apache is trying to send to the user.
</p>
<pre class="wiki">1322698963.939921 open("/mnt/crcns-data/downloads/site-files/news/crcns-neuroinformatics-article.pdf", O_RDONLY|O_LARGEFILE) = 18
1322698963.942795 setsockopt(16, SOL_TCP, TCP_CORK, [1], 4) = 0
1322698963.943860 writev(16, [{"HTTP/1.1 200 OK\r
Date: Thu, 01 D"..., 368}], 1) = 368
1322698963.944845 sendfile(16, 18, [0], 134452) = -1 EPROTO (Protocol error)
1322698963.947758 setsockopt(16, SOL_TCP, TCP_CORK, [0], 4) = 0
1322698963.948434 read(16, 0x83ccd28, 8000) = -1 EAGAIN (Resource temporarily unavailable)
</pre><p>
Here are the corresponding lines in /var/log/messages:
</p>
<pre class="wiki">2011-12-01T00:22:43.946640+00:00 crcns kernel: [ 661.466761] VbglR0HGCMInternalCall: vbglR0HGCMInternalPreprocessCall failed. rc=-2
2011-12-01T00:22:43.946757+00:00 crcns kernel: [ 661.467346] VBoxGuestCommonIOCtl: HGCM_CALL: 64 Failed. rc=-2.
</pre><p>
Please let me know if you would like me to do more tests.
</p>
TicketjefftThu, 01 Dec 2011 01:57:50 GMTattachment sethttps://www.virtualbox.org/ticket/9952
https://www.virtualbox.org/ticket/9952
<ul>
<li><strong>attachment</strong>
set to <em>log_messages_GA412.txt</em>
</li>
</ul>
<p>
/var/log/message - full output from system startup to apache error, guest additions 4.1.2
</p>
Ticketthe729Sun, 04 Dec 2011 00:07:18 GMThttps://www.virtualbox.org/ticket/9952#comment:4
https://www.virtualbox.org/ticket/9952#comment:4
<p>
I have the same issue. In addition, ASCII files seem to work, only binary files fail. I guess this is nothing to do with Apache, although I first noticed the problem because Apache can not serve properly.
</p>
<p>
On my machine, I can not copy a binary file from a vbox share folder to the guest file system using the GUI. It said "protocol error". 'dmesg' outputs the errors:
</p>
<pre class="wiki">[ 157.261163] VbglR0HGCMInternalCall: vbglR0HGCMInternalPreprocessCall failed. rc=-2
[ 157.261216] VBoxGuestCommonIOCtl: HGCM_CALL: 64 Failed. rc=-2.
</pre><p>
And I guess this is the same issue as Ticket <a class="closed ticket" href="https://www.virtualbox.org/ticket/9719" title="defect: &#34;Error splicing file: Protocol error&#34; when copying from vbox shared folder ... (closed: fixed)">#9719</a>.
</p>
<p>
Host: Mac OS X 10.6.8 \
Guest: Ubuntu running kernel 2.6.32-34 \
VBox: 4.1.6 <a class="missing changeset" title="No changeset 74713 in the repository">r74713</a>
</p>
Ticketbobo69Sat, 17 Dec 2011 09:12:30 GMThttps://www.virtualbox.org/ticket/9952#comment:5
https://www.virtualbox.org/ticket/9952#comment:5
<p>
I have also the same issue and same errors accessing html on on host share folder through apache
</p>
<p>
Host: Windows 7 \ Guest: Linux fedora 2.6.34.9-69 \ VBox: 4.1.6 <a class="missing changeset" title="No changeset 74713 in the repository">r74713</a>
VBOXAdditions 4.1.6 <a class="missing changeset" title="No changeset 74713 in the repository">r74713</a>
</p>
<p>
What is really completly incredible in my case is that
</p>
<ul><li>any php file through apache is OK !!!
</li><li>nearly all html file through apache is KO !!!
</li></ul><p>
there is maybe some kind of link with apache acces to share folder...
</p>
TicketedovaleThu, 09 Feb 2012 03:09:19 GMThttps://www.virtualbox.org/ticket/9952#comment:6
https://www.virtualbox.org/ticket/9952#comment:6
<p>
Is there any update on this issue? I am experiencing exactly the same problem with guest ubuntu 10.04, 11.04 and 11.10 running on host Mac OS X 10.6.8 and <a class="wiki" href="https://www.virtualbox.org/wiki/VirtualBox">VirtualBox</a> 4.1.8.
</p>
Ticket