# LXC Container Permission denied 備份失敗

**<span style="color: rgb(35, 111, 161);">錯誤訊息 : </span>**LXC Container 備份時出現下列錯誤訊息，備份失敗

INFO: create storage snapshot 'vzdump'  
INFO: creating vzdump archive '/mnt/pve/xxxxxx/dump/vzdump-lxc-401-2024\_06\_08-00\_19\_50.tar.zst'  
INFO: tar: /mnt/pve/xxxxxx/dump/vzdump-lxc-401-2024\_06\_08-00\_19\_50.tmp: **<span style="color: rgb(224, 62, 45);">Cannot open: Permission denied</span>**  
INFO: tar: Error is not recoverable: exiting now

  
<span style="color: rgb(35, 111, 161);">**問題成因 :**</span>

只有在 <span style="color: rgb(35, 111, 161);">非特權容器 (Unpriviledged container)</span> 才會發生，如果是 <span style="color: rgb(35, 111, 161);">特權容器 (Priviledged container)</span> 則可以順利備份。這兩種模式在 vzdump 程式備份時使用的身份不一樣，前者會使用大於 100000 的 UID，而後者直接用 root 執行。

**<span style="color: rgb(35, 111, 161);">解決方式 : </span>**<span style="color: rgb(0, 0, 0);">修改 pve /etc/vzdump.conf</span>

```
mkdir /temp && mkdir /temp/vzdump
vim /etc/vzdump.conf
```

**<span style="color: rgb(35, 111, 161);">  
</span>**

\# vzdump default settings

<span style="color: rgb(224, 62, 45);">**tmpdir: /temp/vzdump**</span>  
\#dumpdir: DIR  
\#storage: STORAGE\_ID  
\#mode: snapshot|suspend|stop  
\#bwlimit: KBPS  
\#performance: \[max-workers=N\]\[,pbs-entries-max=N\]  
\#ionice: PRI  
\#lockwait: MINUTES  
\#stopwait: MINUTES  
\#stdexcludes: BOOLEAN  
\#mailto: ADDRESSLIST  
\#prune-backups: keep-INTERVAL=N\[,...\]  
\#script: FILENAME  
\#exclude-path: PATHLIST  
\#pigz: N  
\#notes-template: {{guestname}}

存檔後即可  
  
<span style="color: rgb(35, 111, 161);">**資料來源 :** </span>

**節省工具箱 Jason Tools** [<span style="color: rgb(0, 0, 0);">http://blog.jason.tools/2021/07/proxmox-ve-vzdump-lxc-fail.html</span>](http://blog.jason.tools/2021/07/proxmox-ve-vzdump-lxc-fail.html)