# Scp: /var/lib/one//datastores/0/155/disk.1: Permission denied

**URL:** <https://forum.opennebula.io/t/scp-var-lib-one-datastores-0-155-disk-1-permission-denied/2974>\
**Category:** Product Support\
**Created:** [September 22, 2016, 6:28pm UTC](https://forum.opennebula.io/t/scp-var-lib-one-datastores-0-155-disk-1-permission-denied/2974 "2016-09-22T18:28:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_Stein](https://avatars.discourse-cdn.com/v4/letter/t/3d9bf3/32.png) [@Thomas\_Stein](https://forum.opennebula.io/u/Thomas_Stein)\
**Post date:** [September 22, 2016, 6:28pm UTC](https://forum.opennebula.io/t/scp-var-lib-one-datastores-0-155-disk-1-permission-denied/2974/1 "2016-09-22T18:28:45Z")

</div>

Hello.

After powering off and afterwards on a virtual machine i get:

```auto
Thu Sep 22 20:04:32 2016 [Z0][VMM][I]: scp: /var/lib/one//datastores/0/155/disk.1: Permission denied
Thu Sep 22 20:04:32 2016 [Z0][VMM][E]: Error copying context ISO to mydomain.tld:/var/lib/one//datastores/0/155/disk.1

disk.1 is owned by the qemu user. After chown the file to oneadmin everything works. Question remains. Is this an error of opennebula or is my setup faulty.

thanks and cheers
```

---

<div class="post-metadata">

**Author:** ![jmelis](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jmelis/32/24_2.png) [@jmelis](https://forum.opennebula.io/u/jmelis)\
**Post date:** [September 23, 2016, 10:02am UTC](https://forum.opennebula.io/t/scp-var-lib-one-datastores-0-155-disk-1-permission-denied/2974/2 "2016-09-23T10:02:02Z")

</div>

How have you installed OpenNebula? What OS? what packages?

What are the contents of /etc/libvirt/libvirtd.conf and /etc/libvirt/qemu.conf? can you gist them?

---

<div class="post-metadata">

**Author:** ![Thomas\_Stein](https://avatars.discourse-cdn.com/v4/letter/t/3d9bf3/32.png) [@Thomas\_Stein](https://forum.opennebula.io/u/Thomas_Stein)\
**Post date:** [September 23, 2016, 12:16pm UTC](https://forum.opennebula.io/t/scp-var-lib-one-datastores-0-155-disk-1-permission-denied/2974/3 "2016-09-23T12:16:21Z")

</div>

Hello Jaime.

It’s a gentoo system. Opennebula compiled from source. The relevant part from qemu.conf is:

```
# The user for QEMU processes run by the system instance. It can be
# specified as a user name or as a user id. The qemu driver will try to
# parse this value first as a name and then, if the name doesn't exist,
# as a user id.
#
# Since a sequence of digits is a valid user name, a leading plus sign
# can be used to ensure that a user id will not be interpreted as a user
# name.
#
# Some examples of valid values are:
#
# user = "qemu" # A user named "qemu"
# user = "+0" # Super user (uid=0)
# user = "100" # A user named "100" or a user with uid=100
#
#user = "root"

# The group for QEMU processes run by the system instance. It can be
# specified in a similar way to user.
#group = "root"

# Whether libvirt should dynamically change file ownership
# to match the configured user/group above. Defaults to 1.
# Set to 0 to disable file ownership changes.
#dynamic_ownership = 1# 

```

So pretty much default. libvirtd,conf default too. Should i change user to oneadmin?

thanks and cheers

---

<div class="post-metadata">

**Author:** ![jmelis](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jmelis/32/24_2.png) [@jmelis](https://forum.opennebula.io/u/jmelis)\
**Post date:** [September 23, 2016, 12:23pm UTC](https://forum.opennebula.io/t/scp-var-lib-one-datastores-0-155-disk-1-permission-denied/2974/4 "2016-09-23T12:23:52Z")

</div>

Happy to hear that OpenNebula is running on Gentoo somewhere 😉

Try with this ``/etc/libvirt/qemu.conf`(only those lines in the whole file)`:

```
user = "oneadmin"
group = "oneadmin"
dynamic_ownership = 0

```

Restart libvirtd afterwards.

This should be documented here:  
[http://docs.opennebula.org/5.0/deployment/open\_cloud\_host\_setup/kvm\_driver.html](http://docs.opennebula.org/5.0/deployment/open_cloud_host_setup/kvm_driver.html)

It used to be, but somehow it’s not there any more… So I opened a ticket to re-add it.  
[http://dev.opennebula.org/issues/4818](http://dev.opennebula.org/issues/4818)

cheers!

---

<div class="post-metadata">

**Author:** ![Thomas\_Stein](https://avatars.discourse-cdn.com/v4/letter/t/3d9bf3/32.png) [@Thomas\_Stein](https://forum.opennebula.io/u/Thomas_Stein)\
**Post date:** [September 23, 2016, 12:34pm UTC](https://forum.opennebula.io/t/scp-var-lib-one-datastores-0-155-disk-1-permission-denied/2974/5 "2016-09-23T12:34:38Z")

</div>

Thanks Jaime. Works as expected. 🙂

cheers  
t.

---

<div class="post-metadata">

**Author:** ![niando](https://avatars.discourse-cdn.com/v4/letter/n/58956e/32.png) [@niando](https://forum.opennebula.io/u/niando)\
**Post date:** [April 6, 2017, 2:18pm UTC](https://forum.opennebula.io/t/scp-var-lib-one-datastores-0-155-disk-1-permission-denied/2974/6 "2017-04-06T14:18:59Z")

</div>

Hello,

I am using the Opennebula version 5.2.1 on Ubuntu 16.04. LTS and I have the same error.

In my case disk.1 is also owned by the qemu user, but disk.0 is owned by the root. When I check the /etc/libvirt/qemu.conf, i have already the three lines you mentioned in this post.

It is strange that it was working without any problem and all the previous virtual machines had no such error. When I checked their permissions, I saw that disk0 and disk1 owned by libvirt-qemu user. I changed the permissions according to it, but I still got the following error:

Thu Apr 6 16:10:18 2017 [Z0][VM][I]: New state is POWEROFF  
Thu Apr 6 16:10:18 2017 [Z0][VM][I]: New LCM state is LCM\_INIT  
Thu Apr 6 16:13:53 2017 [Z0][VM][I]: New state is ACTIVE  
Thu Apr 6 16:13:53 2017 [Z0][VM][I]: New LCM state is BOOT\_POWEROFF  
Thu Apr 6 16:13:53 2017 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/43/deployment.11  
Thu Apr 6 16:13:54 2017 [Z0][VMM][I]: Command execution fail: /var/lib/one/remotes/tm/ssh/context /var/lib/one/vms/43/context.sh sestserver:/DATASTORE/0/43/disk.1 43 0  
Thu Apr 6 16:13:54 2017 [Z0][VMM][I]: context: Generating context block device at sestserver:/DATASTORE/0/43/disk.1  
Thu Apr 6 16:13:54 2017 [Z0][VMM][E]: context: Command “scp /var/lib/one/datastores/.isofiles/43/43.iso sestserver:/DATASTORE/0/43/disk.1” failed: Warning: Permanently added ‘sestserver,192.168.2.10’ (ECDSA) to the list of known hosts.  
Thu Apr 6 16:13:54 2017 [Z0][VMM][I]: scp: /DATASTORE/0/43/disk.1: Permission denied  
Thu Apr 6 16:13:54 2017 [Z0][VMM][E]: Error copying context ISO to sestserver:/DATASTORE/0/43/disk.1  
Thu Apr 6 16:13:54 2017 [Z0][VMM][I]: ExitCode: 255  
Thu Apr 6 16:13:54 2017 [Z0][VMM][I]: Failed to execute transfer manager driver operation: tm\_context.  
Thu Apr 6 16:13:54 2017 [Z0][VMM][E]: Error deploying virtual machine: Error copying context ISO to sestserver:/DATASTORE/0/43/disk.1  
Thu Apr 6 16:13:54 2017 [Z0][VM][I]: New state is POWEROFF  
Thu Apr 6 16:13:54 2017 [Z0][VM][I]: New LCM state is LCM\_INIT

Do you have any idea why I am having this problem?
