{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/18584","labels_url":"https://api.github.com/repos/docker/docker/issues/18584/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/18584/comments","events_url":"https://api.github.com/repos/docker/docker/issues/18584/events","html_url":"https://github.com/docker/docker/issues/18584","id":121588620,"number":18584,"title":"File contents inconsistent when volume is a vboxfs mount","user":{"login":"doozr","id":1052926,"avatar_url":"https://avatars.githubusercontent.com/u/1052926?v=3","gravatar_id":"","url":"https://api.github.com/users/doozr","html_url":"https://github.com/doozr","followers_url":"https://api.github.com/users/doozr/followers","following_url":"https://api.github.com/users/doozr/following{/other_user}","gists_url":"https://api.github.com/users/doozr/gists{/gist_id}","starred_url":"https://api.github.com/users/doozr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doozr/subscriptions","organizations_url":"https://api.github.com/users/doozr/orgs","repos_url":"https://api.github.com/users/doozr/repos","events_url":"https://api.github.com/users/doozr/events{/privacy}","received_events_url":"https://api.github.com/users/doozr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-10T22:10:28Z","updated_at":"2015-12-10T22:10:29Z","closed_at":null,"body":"When using vboxsf to share a folder to a VM and that folder is mounted as a volume in a container, the contents of the files is inconsistent depending which program is used to view it.\r\n\r\nWorking example using Docker 1.9.1\r\n============================\r\n\r\nCreate a Dockerfile as follows\r\n\r\n```\r\nFROM alpine:3.2\r\n\r\nRUN apk add --update python\r\n\r\nENTRYPOINT [\"sh\", \"-c\"]\r\nCMD [\"while true; do sleep 10; done\"]\r\n```\r\n```\r\n$ docker build -t testimage .\r\n```\r\n\r\nMount a directory via into a VirtualBox VM using vboxfs containing a single file, test.py:\r\n\r\n```\r\nprint \"HELLO\"\r\n```\r\n\r\n```\r\n$ ls /path/to/mount\r\ntest.py\r\n```\r\n\r\nRun a container, mounting the shared folder:\r\n\r\n```\r\n$ docker run -d -v /path/to/mount:/files testimage\r\na7741514db36343c7f9df7f94685555a75072e6eb3c9de72ddec983f050ec401\r\n```\r\n\r\nExec a shell on the container and run the python script, and cat its contents:\r\n\r\n```\r\n$ docker exec -it a7741514db36 sh\r\n# cd /files\r\n# python test.py\r\nHELLO\r\n# cat test.py\r\nprint \"HELLO\"\r\n# less test.py\r\n(contents are: print \"HELLO\")\r\n# vi test.py\r\n(contents are: print \"HELLO\")\r\n```\r\n\r\nEdit the files on the host machine, changing HELLO to GOODBYE. Then use docker exec again:\r\n\r\n```\r\n$ docker exec -it a7741514db36 sh\r\n# cd /files\r\n# python test.py\r\nHELLO\r\n# cat test.py\r\nprint \"HELLO\"\r\n# less test.py\r\n(contents are: print \"GOODBYE\")\r\n# vi test.py\r\n(contents are: print \"GOODBYE\")\r\n```\r\n\r\nAt demonstrated, the python and cat executables still see the original contents of the file, but the less and vi executables see the new contents. \r\n\r\nOne final demonstration; edit the file inside the container using vi, then execute it with python:\r\n\r\n```\r\n# vi /files/test.py\r\n(change GOODBYE to TESTING)\r\n# python /files/test.py\r\nHELLO\r\n# cat /files/test.py\r\nprint \"HELLO\"\r\n# less /files/test.py\r\n(contents are: print \"TESTING\")\r\n```\r\n\r\nPython again executes the original contents of the file, and cat sees the same. Vi and less see, again, the edited files.\r\n\r\n```\r\n$ docker --version\r\nDocker version 1.9.1, build a34a1d5\r\n```"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/163764089","html_url":"https://github.com/docker/docker/issues/18584#issuecomment-163764089","issue_url":"https://api.github.com/repos/docker/docker/issues/18584","id":163764089,"user":{"login":"GordonTheTurtle","id":10620046,"avatar_url":"https://avatars.githubusercontent.com/u/10620046?v=3","gravatar_id":"","url":"https://api.github.com/users/GordonTheTurtle","html_url":"https://github.com/GordonTheTurtle","followers_url":"https://api.github.com/users/GordonTheTurtle/followers","following_url":"https://api.github.com/users/GordonTheTurtle/following{/other_user}","gists_url":"https://api.github.com/users/GordonTheTurtle/gists{/gist_id}","starred_url":"https://api.github.com/users/GordonTheTurtle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GordonTheTurtle/subscriptions","organizations_url":"https://api.github.com/users/GordonTheTurtle/orgs","repos_url":"https://api.github.com/users/GordonTheTurtle/repos","events_url":"https://api.github.com/users/GordonTheTurtle/events{/privacy}","received_events_url":"https://api.github.com/users/GordonTheTurtle/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T22:10:28Z","updated_at":"2015-12-10T22:10:28Z","body":"Hi!\n\t\nPlease read this important information about creating issues.\n\nIf you are reporting a new issue, make sure that we do not have any duplicates already open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead.\n\nIf you suspect your issue is a bug, please edit your issue description to include the BUG REPORT INFORMATION shown below. If you fail to provide this information within 7 days, we cannot debug your issue and will close it. We will, however, reopen it if you later provide the information.\n\nThis is an automated, informational response. \n\nThank you.\n\nFor more information about reporting issues, see https://github.com/docker/docker/blob/master/CONTRIBUTING.md#reporting-other-issues \n\n-----------------------------\nBUG REPORT INFORMATION\n-----------------------------\nUse the commands below to provide key information from your environment:\n\n`docker version`:\n`docker info`:\n`uname -a`:\n\nProvide additional environment details (AWS, VirtualBox, physical, etc.):\n\n\n\nList the steps to reproduce the issue:\n1.\n2.\n3.\n\n\nDescribe the results you received:\n\n\nDescribe the results you expected:\n\n\nProvide additional info you think is important:\n\n\n----------END REPORT ---------\n\n\n\n#ENEEDMOREINFO\n"}}