Is there a way to share host (ubuntu) file system with guest (centos 7)? - linux

I am trying to use virsh and domain xml to launch a Centos 7 guest from ubuntu 16.04 LTS host.
The "filesystem" node that i am using in domain xml is as below:
<filesystem type='mount' accessmode='passthrough'>
<driver type='path' wrpolicy='immediate'/>
<source dir='/opt/test'/>
<target dir='testlabel'/>
</filesystem>
With the above config, "testlabel" is not visible in the guest and hence i am not able to mount it. Is there anything that i am missing?
I tried to have 9p modules in guest but they don't seem to be available in centos 7.
I do not want to use network based file sharing like NFS or glusterfs either.

RHEL-7 (and thus CentOS-7) explicitly does not support the 9p filesystem. It is disabled in guest kernel builds and also disabled in QEMU builds for RHEL hosts. The reason is that 9p support in QEMU has been largely unmaintained upstream and the QEMU community doesn't have confidence its is security or performance.
If you want to share filesystem locations, pretty much your only choice is to use a traditional network filesystem, whether NFS, SAMBA, or something tunnelled like SSHFS.
Work is ongoing upstream to support a new technology called virtio-vsock, which will allow running NFS-over-vsock, bypassing the need for networking - think of it as akin to NFS over UNIX sockets. This is not ready for use yet though, so not possible for an Ubuntu/RHEL-7 pair.

Use for the guest (CentOS 7) the kernel from the CentOSPlus repository Wiki CentOSPlus. The CentOSPlus kernel has the 9p file system support build in. You can install the "kernel-plus" kernel with
yum --enablerepo=centosplus install kernel-plus
Start the guest with the "kernel-plus" kernel and
mount -t 9p -o trans=virtio {sharetarget} {mountpoint}
works. I use it this way on CentOS 7 guest systems.

Related

Undrestanding docker: what is the dockerhub Ubuntu image?

I configured Windows Subsystem for Linux, installed a Microsoft packaged Ubuntu on Win 10, to get my hands on Docker using Linux. From what I understood, Docker does not need a guest OS, unlike VMWare - that's one of the main advantages.
I browsed the dockerhub and found an official Ubuntu image. What is it for, as there is no need of a guest OS?
Shared OS is probably the wrong term here, because many include the Linux distribution and filesystem as part of the OS. Containers run with a shared Linux kernel, but in isolated namespaces from the host and each other. One of those namespaces is the mount namespace, including your root filesystem. Therefore when you enter a container, the files in /bin and other directories are assembled from the image (plus volume mounts, and changes made within the container).
The Ubuntu docker image is an initial filesystem that includes a minimal Ubuntu environment you can use the create other images for running your containers. If you were to start a container without that, you wouldn't have anything, no /bin/sh, no apt, no libraries, and would have to create every binary and needed libraries to run commands inside the container first.

why azure file share is not mounting on centos versions under 7?

Is there any way to create Azure File Share mounts on CentOS versions lower as 7?
Azure documentation recommends centos 7+ for it.
I have tried the same for CentOS 7 and Ubuntu 16.04.Its working fine.
But for CentOS version under 7 it is not working.
But for CentOS version under 7 it is not working.
It is a by design behavior, because Azure files share requires SMB 2 dialect which supported by newer CIFS module in RHEL 7.
Pasting the note from Redhat Support Forum:
"For RHEL when you use the mount command your are using the kernel
driver for cifs. The features for cifs commections are tied to the
kernel module providing this. You can see details for this with module
"man mount.cifs" The RHEL6 kernel is only capabable of mounting older
1.0 smb protocol mounts. RHEL7 however can mount smb2 version of the protocal since the kernel is using a newer cifs module. On RHEL7 in
"man mount.cifs" you will see the options to specify vers= 1.0, 2.0,
2.1, or 3.0."
If you want to mount Azure files share to Centos 6, as a workaround we can update your kernel to 3.1.0 or 4.6, install the last version of cifs-utils, but it is not recommended.
As per my knowledge,you are missing the mount-point directory in the Linux VM to mount the SMB share to.
In Linux VM: You need to create a local directory at /mnt/mymountdirectory, use the following example to create a local directory:
sudo mkdir -p /mnt/mymountdirectory
Then Mount the SMB share to the local directory by providing your own storage account username and storage account key for the mount credentials as follows:
sudo mount -t cifs //myStorageAccount.file.core.windows.net/mystorageshare /mnt/mymountdirectory -o vers=3.0,username=mystorageaccount,password=mystorageaccountkey,dir_mode=0777,file_mode=0777
For more details, refer “Use Azure Files with Linux”.
And also, you may refer MSDN thread, which addressing your query.

Installing / maintaining Jenkins on a Linux host machine

We are currently provisioning a physical server as our automation server. We are making considerations as far as what our native operating system should be on this physical machine.
We are going to use a Linux OS as our operating system. From the Jenkins download page, I can see that Jenkins’ package distribution is available to Red Hat / Fedora / CentOS (which we will not be using), as well as Ubuntu / Debian. I also notice that a Generic Java package (WAR) distribution is available.
Am I correct in assuming that if we use a non-Ubuntu / non-Debian
operating system, we can still install Jenkins via the WAR
distribution without issue?
If we are not able to install via WAR without issue, are we relegated
to using Debian / Ubuntu if we’re going to install Jenkins on a Linux
machine (with the possibility of Red Hat / Fedora / CentOS ruled
out)?
It should probably be noted that we will likely install / upgrade on the Jenkins LTS release schedule.
Thanks for any guidance from anybody who may have experience installing / maintaining a Jenkins instance on a Linux machine!

Oracle on lxc in ubuntu

I'm currently trying to install an oracle server (11g) in a linux container on ubuntu (following this tutorial (http://www2.hawaii.edu/~lipyeow/ics321/2014fall/installoracle11g.html).
When I try to change the file handler with sysctl, the modifications doesn't save into my container. Moreover, when I make the modification in the main ubuntu kernel, it propagates to the containers, so my question is as follow:
How can I modify the file handlers only in my oracle container ?
Thanks.
Try out the Orabuntu-LXC project code. It supports Ubuntu 16.04, 17.04, 17.10 and is purpose-built for running Any Oracle on Any Linux, including Ubuntu Linux. Note that as you probably already know, Oracle Corp does not formally support or certify Oracle on Ubuntu Linux.
As far as you question about the file handlers, some sysctl values can only be set at the LXC host level, and some can be set in the container.
https://sites.google.com/site/nandydandyoracle/oracle-rac-in-lxc-linux-containers/oracle-lxc-vlc#TOC-Install-the-etc-sysctl.conf-File-Required-for-Oracle
https://github.com/gstanden/orabuntu-lxc
https://sites.google.com/site/nandydandyoracle/
Please note that the step-by-step guides are quite old and that the basic LXC infrastructure together with OpenvSwitch, an LXC-containerized DNS/DHCP, and an optional SCST Linux SAN can all be installed on Ubuntu 16.04, 17.04 and 17.10 with one command:
./anylinux-services.sh
after completion of which all you would need do is download your Oracle database installtion media and install.

Does containers depends on to a specific host?

I have an application which have kernel space code and it is compiled in linux kernel 2.6.32-431.el6.x86_64 (centos 6.5). Then it is installed as kernel module to run the application. When I tried to containerized my application with Docker (which is installed in Amazon Linux AWS EC2 instance), it complains about the higher kernel version is incompatible with the module. Is it I have to install Docker in a host which have kernel version as 2.6.32-431.el6.x86_64? If yes, does our containers depend on to a specific host machine?
Containers include the application and all of its dependencies, but share the kernel with other containers. They run as an isolated process in userspace on the host operating system.
https://www.docker.com/what-docker
Docker containers use host's kernel. You may install the same version of the kernel required in the container as host's kernel, but you will not be able to run CentOS6 compiled kernel on Amazon Linux.
Considering your specific application requirements, I would suggest using
"real" virtualization solution such as XEN or KVM that allows you to use your own kernel in a VM.

Resources