Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError: [Errno 30] Read-only file system #209

Closed
rlayte opened this issue Dec 26, 2011 · 25 comments

Comments

Projects
None yet
@rlayte
Copy link

commented Dec 26, 2011

I've started getting a strange error when trying to create new environments:

Traceback (most recent call last):
     File "/usr/local/bin/virtualenv", line 9, in <module>
       load_entry_point('virtualenv==1.7', 'console_scripts', 'virtualenv')()
     File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 928, in main
       never_download=options.never_download)
     File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 1029, in create_environment
       site_packages=site_packages, clear=clear))
     File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 1145, in install_python
       fix_local_scheme(home_dir)
     File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 1430, in fix_local_scheme
       os.symlink(os.path.abspath(home_dir), local_path)
OSError: [Errno 30] Read-only file system

I don't seem to have trouble creating symlinks under any other circumstances.

I'm running Ubuntu 11.04 through Virtualbox - I've tried destroying and rebuilding the box from scratch (using an unchanged puppet manifest), but the same error persists.

@carljm

This comment has been minimized.

Copy link
Contributor

commented Jan 3, 2012

I'm afraid there's not much I can do here, as I'm not able to reproduce the failure. I don't know why you'd get a read-only filesystem error unless the filesystem you're trying to create the virtualenv on is in fact read-only.

This code has changed in the development version of virtualenv, so you could try with virtualenv==dev and see if that helps.

@rlayte rlayte closed this Jan 16, 2012

@lylepratt

This comment has been minimized.

Copy link

commented Jan 19, 2012

I'm also having this problem on Ubuntu 11.04 on Virtualbox. @rlayte if you figured out how to solve this, I'd love to know how.

@rlayte

This comment has been minimized.

Copy link
Author

commented Jan 19, 2012

I'm pretty sure this is a virtualbox issue now so should probably be raised with them if you want a real solution to it.

I 'solved' it by moving the .virtualenvs directory into a non-shared folder as the problem only exists on folders shared with os x.

I ultimately decided to move away from virtualbox due to this kind of instability.

@lylepratt

This comment has been minimized.

Copy link

commented Jan 19, 2012

I ended up giving the shared folder group write permissions in OSX, then remounted it in Ubuntu, and it seemed to solve the problem.

@oakwhiz

This comment has been minimized.

Copy link

commented Jun 16, 2012

Yikes, ran into this issue just now, but I think it's a VirtualBox bug: https://www.virtualbox.org/ticket/10085#comment:12

Basically symlinks don't work in shared folders anymore for security reasons.

@tedtieken

This comment has been minimized.

Copy link

commented Aug 2, 2012

This can be solved on virtualbox when the issues are created by shared folders by running:

virtualenv ~/[my-env-name]
source ~/[my-env-name]/bin/activate

This won't store your environment in your folder, but best practice is to use requirements.txt and tell your VCS to ignore your environment tree

@lehrblogger

This comment has been minimized.

Copy link

commented Aug 14, 2012

Update: Of course, a good night's sleep makes everything clearer. Installing python-dev as sudo changed permissions in some Python files that caused the virtualenv command to fail, but I can just run that as sudo and it works.

I'm seeing this same error. If I create a fresh VM from the base lucid32 box and then execute the following commands:

  • sudo apt-get install python-pip
  • sudo pip install virtualenv
  • cd /vagrant/
  • virtualenv test0
  • sudo apt-get install python-dev
  • virtualenv test1

Then the first virtualenv will be created successfully, but the second will fail with the above [Errno 30] Read-only file system. I've posted the full output of this process here: https://gist.github.com/3346994. (I need python-dev for mysql-python.)

Does anyone know how I might fix/work around this? I'd strongly prefer to keep using shared folders, and this seems different than the issue with VirtualBox. Thanks, and let me know if I can provide any more information!

@jokull

This comment has been minimized.

Copy link

commented Sep 18, 2012

sudo pip install virtualenv==dev did the trick for me. I’m on OS X Lion host and Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-23-generic x86_64) as guest.

@lehrblogger

This comment has been minimized.

Copy link

commented Nov 26, 2012

I noticed this again when I tried to set up a fresh VM, and it seems that a change between virtualenv 1.8.2 and 1.8.3 caused that error to come back:

vagrant@lucid32:/vagrant$ virtualenv test
New python executable in test/bin/python
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 9, in <module>
    load_entry_point('virtualenv==1.8.3', 'console_scripts', 'virtualenv')()
  File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 961, in main
    never_download=options.never_download)
  File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 1062, in create_environment
    site_packages=site_packages, clear=clear))
  File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 1482, in install_python
    os.symlink(py_executable_base, full_pth)
OSError: [Errno 30] Read-only file system

I can use 1.8.2 for now, but thought I'd mention here. Thanks!

@g2p

This comment has been minimized.

Copy link
Contributor

commented Nov 27, 2012

@lehrblogger Could you run strace -f virtualenv test, to pinpoint which paths are causing the error?

@g2p

This comment has been minimized.

Copy link
Contributor

commented Dec 4, 2012

@brentsmyth The relevant bit isn't there. Use a pastebin or a gist.

@howardroark

This comment has been minimized.

Copy link

commented Dec 4, 2012

much better idea...

http://pastebin.com/imzmMYFj

@howardroark

This comment has been minimized.

Copy link

commented Dec 4, 2012

The problem lies in virtualbox though. You can find some work around options in these links...

hashicorp/vagrant#713
http://ahtik.com/blog/2012/08/16/fixing-your-virtualbox-shared-folder-symlink-error/

@lehrblogger

This comment has been minimized.

Copy link

commented Dec 5, 2012

@g2p !! Sorry it took me so long to get to this, I was travelling and must have missed the email.

https://gist.github.com/4211296

I'm running Mac OS X 10.8.2 and just upgraded to the latest versions of VirtualBox (4.2.4) and Vagrant (1.0.5). I'm happy to provide more info if it'd be helpful, and I promise I'll respond more quickly :)

@lehrblogger

This comment has been minimized.

Copy link

commented Dec 5, 2012

(It's fine if I have to use one of the VirtualBox workarounds, but the weird thing is that it works with virtualenv 1.8.2 and not 1.8.4 – see the end of my gist.)

@ngrilly

This comment has been minimized.

Copy link

commented Dec 28, 2012

I ran into the same issue. Using VBoxManage setextradata as proposed in https://www.virtualbox.org/ticket/10085 worked for me. But this is another little thing that makes the process of running a virtual local dev server unnecessary cumbersome :)

@lehrblogger

This comment has been minimized.

Copy link

commented Dec 31, 2012

I've been able to get VBoxManage setextradata to work for me too (with virtualenv 1.8.4) by using "v-root" as my "SHARE_NAME" in my Vagranfile, as suggested in this comment. Thanks everyone for the info/suggestions!

@sorokins

This comment has been minimized.

Copy link

commented Jan 19, 2013

My steps to fix it:

  1. Use virtualenv==1.8.2 (not working with 1.8.4!)
  2. setextradata in host OS:
VBoxManage setextradata CENTOS VBoxInternal2/SharedFoldersEnableSymlinksCreate/home/oe 1

, where CENTOS - Virtualbox OS name, /home/oe - name of mounted folder
3. Mount device in guest OS with read-write permissions:

sudo mount -t vboxsf -o rw,uid=1000 shared_folder /mnt/shared_folder

, where uid=1000 - uid of current user in guest OS (see /etc/passwd).

@socrateslee

This comment has been minimized.

Copy link

commented Nov 24, 2014

upgrade virtualenv to the latest version(1.11.6), and use it as

virtualenv --always-copy testenv

the options will not use hard link but copy the files

@liaohuqiu

This comment has been minimized.

@dmcnulla

This comment has been minimized.

Copy link

commented Sep 20, 2016

I got this error on a shared directory from the vm host. When I switched to a directory that isn't shared, it was fine.

@o92

This comment has been minimized.

Copy link

commented Apr 15, 2017

@socrateslee Thanks mate. You saved me a lot of hassle!

@yuhaimahaiyin

This comment has been minimized.

Copy link

commented May 26, 2017

the reason is you tried to start the virtualenv in a shared folder

@svrajput

This comment has been minimized.

Copy link

commented Jul 26, 2017

OSError: [Errno 30] Read-only file system
if you have using shared drive inside vm and trying to execute tox inside that directory it will throw this error. Simple solution is copy that source code inside some directory in vm, lets say inside your home directory /home/sunil/projectName/ . and execute tox command inside this directory.

@dahluwalia-ag

This comment has been minimized.

Copy link

commented Oct 17, 2018

Tox now has a way to set not using symlinks in the virtualenv.

`[testenv]

alwayscopy = True`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.