How to mount an NFS share with rootless Podman? - mount

How can I mount the NFS share mynfsserver.example.com:/path/to/share
when running rootless Podman?
I'm running the latest released Podman as of today (8 January 2022).
$ podman --version
podman version 3.4.4
$
Linux kernel version is 5.15.12.
$ uname -r
5.15.12-200.fc35.x86_64
$

Update 2022-05-31
I'm not sure this answer is correct.
I also asked a question about this in the discussion forum in the Podman Github repo.
Old answer
Support for rootless mounting of an NFS share
is now supported in Podman if you are running the very latest development branches of Podman and the Linux kernel.
To mount an NFS share when running rootless Podman:
podman volume create --opt type=nfs --opt o=async --opt device=mynfsserver.example.com:/path/to/share
Unfortunately it will take a bit of time before support lands in the official packages. (Podman 3.4.4 and Linux 5.15.12 does not have support)
References:
Podman chat channel messages 6 January 2022:
Rootless mounting of NFS just got merged into upstream kernel
podman volume create --opt type=nfs --opt o=async --opt device=mynfsserver:/path/to/share
21:49
neat that it works rootless now

This does not answer your question directly. I can mount an NFS directory that's already mounted on the host file system with
podman run --runtime=/usr/bin/crun --group-add=keep-groups --volume=/storage/nfs/outside_dir:/in_container_dir --storage-driver overlay --storage-opt "overlay.mount_program=/usr/bin/fuse-overlayfs" --userns=keep-id -it registry.access.redhat.com/ubi8/ubi

Related

how to install OpenStack on Ubuntu in 2022

On youtube there are many guides that show how to install openstack on ubuntu I have tried them and they seem not to work
For example with Devstack I fail every time the installation with .Stack.sh, with MicroStack I fail the initialization
I can't install OpenStack in any way!
could somebody help me?
I have installed openstack from various different ways but for me installing through Devstack is the easiest and the most convenient way to do it.
Let me share the installation steps that I use:
Firstly few prerequisites:
A fresh Ubuntu 20.04 installation (Ubuntu 18.04 Works)
8 GB RAM (4 GB RAM works)
4 vCPUs (2 vCPUs works)
Hard disk capacity of 20 GB (min 10 GB)
Step 1 : apt update -y && apt upgrade -y
Step 2: Create Stack user:
sudo adduser -s /bin/bash -d /opt/stack -m stack
echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
su - stack
Step 3:
git clone https://git.openstack.org/openstack-dev/devstack
cd devstack
Step 4: Create devstack configuration file
vim local.conf
Paste this:
[[local|localrc]]
# Password for KeyStone, Database, RabbitMQ and Service
ADMIN_PASSWORD=admin
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
# Host IP - get your Server/VM IP address from ip addr command
HOST_IP=0.0.0.0
Step 5: ./stack.sh
The setup will take about 10-15 minutes depending upon your system. Once installation is complete you can access the dashboard using https://your-ip/dashboard
Note: Incase the stack.sh fails make sure to use ./unstack and ./clean.sh before you use stack.sh again.

How to mount vmware shared folders in WSL2

I have a Mac, and install a Win10 VM by vmware fusion, the shared folders between Mac and Win10 VM use drive letter Z: or \vmware-host
And I mapped a network address \192.168.111.49\Builds to drive letter Y:
Then I install WSL2 in the Win10 VM, and linux subsystem Ubuntu 20.04 LTS
I want to mount all drive letter in Ubuntu, C: is automatically mount /mnt/c
And i use these cmd to mount Y:
sudo mkdir /mnt/y
sudo mount -t cifs -o username=xxx,password=xxxx,domain=xxx //192.168.111.49/Builds /mnt/y
It's OK
However, when I try mount Z:, it's not work
# from vmware official site
$ sudo vmhgfs-fuse -d .host:/ /mnt/z -o subtype=vmhgfs-fuse,allow_other
Segmentation fault (core dumped)
# try to use drvfs
$ sudo mount -t drvfs Z: /mnt/z
mount: /mnt/z: special device Z: does not exist.
<3>init: (457) ERROR: UtilCreateProcessAndWait:489: /bin/mount failed with status 0x2000
<3>init: (457) ERROR: MountPlan9:478: mount cache=mmap,rw,trans=fd,rfdno=3,wfdno=3,msize=65536,aname=drvfs;path=Z:;symlinkroot=/mnt/ failed 2
No such file or directory
# like network address
$ sudo mount -t cifs -o username=xxx,password=xxx //vmware-host/ /mnt/z
mount: /mnt/z: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.
And I check my open-vm-tools version
$ sudo apt-get upgrade open-vm-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
open-vm-tools is already the newest version (2:11.1.5-1~ubuntu20.04.2).
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
It's already newest.
Any help? Thanks.
I found the reason is I run cmd or powershell as administrator
If I don't use administator, the following mount is OK
sudo mount -t drvfs Z: /mnt/z

Why is ncat not found on Git Bash?

user_1 (master *) 1_EchoServer $ python -m http.server 8000
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
127.0.0.1 - - [30/Sep/2017 18:57:11] "GET / HTTP/1.1" 200 -
Set up a simple server. I want to connect to it with ncat to learn HTTP.
I install ncat (pip install nmap):
user_1 Documents $ pip install nmap
Requirement already satisfied: nmap in c:\python36\lib\site-packages
Then, when I try and connect, cmd not found. It was working earlier. Not sure how I broke it.
user_1 Documents $ pip install nmap
Requirement already satisfied: nmap in c:\python36\lib\site-packages
user_1 Documents $ ncat -l 9999
bash: ncat: command not found
I am using git bash on windows, and I have set up python36 on c drive and changed env variables and path accordingly.
I have been in this problem today and I solved it.
the Nmap command must be in the $PATH environment variable for the discovery service account. To do this on windows do the following steps
Click Start > Control Panel > System
Click the Advanced tab, and select Environment Variables.
Edit the Path system variable and add the directory where Nmap is installed.
Restart the computer.
If you do this task, Nmap should be available to services on the computer and the command will be found in the terminal
The Python "nmap" package which you installed with pip install nmap is only an output parsing library. It does not include the Nmap binary. The "nmap" package available in the Windows Subsystem for Linux (a.k.a. Bash on Windows, a.k.a. Ubuntu on Windows) does not currently work properly and is unsupported.
The only place to get Nmap (and Ncat) in ready-to-use format (binary executable) on Windows is directly from nmap.org.

Cloudstack 4.6.0 system vm are stuck in Starting state

I just finished CloudStack 4.6.0 installation in CentOS 7 and system vms are not able to start, they are stuck in the Staring state. Hipervisor is KVM. I did download the system vm template by this:
/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /secondary -u http://cloudstack.apt-get.eu/systemvm/4.6/systemvm64template-4.6.0-kvm.qcow2.bz2 -h kvm -F
Please let me know what other information to provide. Thank you
been through this error and I can understand the stress :)
Just run the following command
sudo yum upgrade
And then restart cloudstack management server.
Hope this helps.

What does cifs_mount failed w/return code = -22 indicate

I am trying
sudo mount -t cifs //<server>/<share> -o username=user#domain,password=**** /mnt/<mountpoint>
error message:
mount: wrong fs type, bad option, bad superblock on //server/share,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
The syslog has
CIFS VFS: cifs_mount failed w/return code = -22
I am able to mount the same share on another centos system. I can ping the server, mount point directory has been created.
I ran into this problem when using a host name and solved it by using an IP address. E.g.:
use
mount -t cifs //192.168.1.15/share
rather than
mount -t cifs //servername/share
Another possible solution is to install
cifs-utils
.
Ah, the dreaded -22. Basically this seems to be used as a catchall for "something didn't work", although technically it's referred to as an invalid argument.
The client does IMHO a very poor job of telling you the actual problem. (This may not be its fault - it doesn't always have access to that information).
However -- have you checked the logs on the server/machine you are connecting to?
I was connecting to an OS X samba server, and learned from what I found in the logs there that it was necessary to specify additional options under -o as follows:
nounix,sec=ntlmssp
Among the things these settings enable are "allow long names", and "ignore UNIX filename endings"...sec is to specify security flags.
Another possibility is that you're trying to access a filesystem of a type that mount.cifs can't actually handle.
For RHEL/Centos install package - "cifs-utils"
Maybe move the target?
sudo mount -t cifs -o username=user#domain,password=**** //<server>/<share> /mnt/<mountpoint>
Or maybe this solution? (Ubuntu, Debian methods)
sudo apt-get install smbfs
Or for CentOS, RedHat, Fedora try:
sudo yum install samba-client
I had a similar issue on Ubuntu 12.04 with the "mount" package (version 2.20.1-1ubuntu3).
It happened when I was trying to mount the server share using its hostname rahter than its IP.
Another way to solve the issue on Ubuntu was to install the cifs-utils package. That way I could also mount the samba share using the exact same command line (or fstab) but with hostname.
sudo mount -t cifs //hostname/share -o username=user,password=pwd /mnt/share
Just did a clean install of Ubuntu 12.04 LTS and got this trying to hook up my Linux HTPC.
Solved it by running: sudo apt-get install cifs-utils then remounting it.
CIFS returns code "-22" in many cases (not only invalid arguments).
For me installing keyutils did the trick:
apt-get install keyutils
My distribution is "Ubuntu 14.04.2 LTS".
I figured this out by increasing the logging verbosity of CIFS:
echo 7 > /proc/fs/cifs/cifsFYI
# disable again via:
#echo 0 > /proc/fs/cifs/cifsFYI
Documentation on the bitmask ("7") for cifsFYI can be found here: https://www.kernel.org/doc/readme/Documentation-filesystems-cifs-README
After trying to mount once more dmesg included more helpful information:
Dec 7 12:34:20 pc1471 kernel: [ 5442.667417] CIFS VFS: dns_resolve_server_name_to_ip: unable to resolve:
Another maybe helpful link:
http://vlkan.com/blog/post/2015/01/08/smb-mount-troubleshoot/
I have Ubuntu Server 12.10 x64 installed as a VMware VM, running on OS X 10.8 (Mountain Lion).
On the Mac, in SYSTEM PREFERENCES > SHARING > FILE SHARING (on), I added a folder to share. For my tests, I created a new folder within my Public folder called "ubuntu".
In Ubuntu, I issued the following commands:
sudo mkdir /media/target
sudo mount.cifs //10.0.20.3/ubuntu /media/target -o username=davidallie,nounix,sec=ntlmssp,rw
Ubuntu prompted me for the password and, once entered, mounted the folder. I then ran:
df -H
which allowed me to verify the mounts and mount-points.
This has recently manifested thanks to a kernel bug in v5.18.8+, I was able to reproduce on v5.18.9 and v5.18.11.
Here is the relevant ticket on kernel.org, quote:
it appears that kernel 5.18.8 breaks cifs mounts on my machine. With
5.18.7, everything works fine. With 5.18.8, I am getting:
$ sudo mount /mnt/openmediavault/
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel
log messages (dmesg)
The relevant /etc/fstab line is:
//odroidxu4.local/julian /mnt/openmediavault cifs
credentials=/home/julas/.credentials,uid=julas,gid=julas,vers=3.1.1,nobrl,_netdev,auto
0 0
Here is the offending commit, and here is the fix, which applies cleanly to v5.18.11. The cause is, from what I understand, a bug in old versions of the samba server in the negotiation protocol.
If this is your issue, you can:
patch your kernel yourself;
downgrade to v5.18.7;
switch to an LTS kernel;
use the userspace (and also really slow and awful) gvfs-smb;
upgrade the samba version on your server; or
add vers=2.0 to the mount.cifs options in /etc/fstab.
Note that while I haven't tried the last one personally, the venerable #SEBiGEM has confirmed in the comments that it works for v5.18.10.
Note also that I didn't try upgrading samba on the server at all because I hate touching the box it's running on - every time I upgrade anything everything breaks. Doing so might also not be an option for those with NAS appliances.
As a personal sidenote, it's a little sad that so many different things can cause -22. My answer is correct, but very very niche and specific to this point in time. I imagine in a month it will simply be useless noise.
Just experience the problem on RHEL 5. You don't need to install the samba suite, just the samba-client and any dependencies.
Maybe it's too late, but simplest solution described in kernel bug 50631:
in the latest code, unc mount parameter in mandatory. Modified command works for me:
sudo mount -t cifs //<server>/<share> -o username=user#domain,password=****,unc=\\\\<server>\\<share> /mnt/<mountpoint>
Try run the comamnd:
$modinfo cifs
filename: /lib/modules/3.2.0-60-virtual/kernel/fs/cifs/cifs.ko
version: 1.76
description: VFS to access servers complying with the SNIA CIFS Specification e.g. Samba and Windows
license: GPL
author: Steve French <sfrench#us.ibm.com>
srcversion: 9435BBC2F61D29F06643803
depends:
intree: Y
vermagic: 3.2.0-60-virtual SMP mod_unload modversions 686
parm: CIFSMaxBufSize:Network buffer size (not including header). Default: 16384 Range: 8192 to 130048 (int)
parm: cifs_min_rcv:Network buffers in pool. Default: 4 Range: 1 to 64 (int)
parm: cifs_min_small:Small network buffers in pool. Default: 30 Range: 2 to 256 (int)
parm: cifs_max_pending:Simultaneous requests to server. Default: 32767 Range: 2 to 32767. (int)
parm: echo_retries:Number of echo attempts before giving up and reconnecting server. Default: 5. 0 means never reconnect. (ushort)
parm: enable_oplocks:Enable or disable oplocks (bool). Default:y/Y/1 (bool)
If your getting any error then cifs is not installed. Just check with your admin. I thought it helps out.
Adding the option vers=3.0 to the mount command worked for me: sudo mount -t cifs -v <src> <dst> -o ...,vers=3.0,...
You need to install cifs-utils first , just as follows:
sudo yum install cifs-utils
I know this is old, but on older cifs-utils versions, you may have to add the following two lines to /etc/request-key.conf
create cifs.spnego * * /usr/sbin/cifs.upcall -c %k
create dns_resolver * * /usr/sbin/cifs.upcall %k
Workaround without installing additional packages (cifs-utils adds another 81mb in Debian Stretch):
$ FILESERVER_IP=$(getent hosts myfileserver.com | awk '{ print $1 ; exit }')
$ sudo mount -t cifs //${FILESERVER_IP}/<share> -o username=user#domain,password=**** /mnt/<mountpoint>
Many answers, but wasn't work for me.
Solution:
My NAS didn't support Samba 3.0, on which my mount switch automatically.
So I downgraded smb version:
mount -t cifs //192.168.0.2/Share -o rw,vers=1.0,username=*****,password=******* /media/1
It's work.

Resources