"systemctl: command not found" with vagrant on fresh CentOS 6.5 install - centos

I'm creating new vagrant box that uses virtualbox image of CentOS 6.5 that I installed. Inside everything looks fine, but from outside I can't access 80 port.
When I edited my Vagrantfile and added fixed IP:
config.vm.network "private_network", ip: "10.10.10.10"
And I ran vagrant up, I got "systemctl command not found".
I think this it tries to setup network interface, but fails because it uses systemctl which, I assume is not available in this version or distribution.
Is there a way to add it, or configure IP/network interface manually? So that vagrant connects to it?
==> default: Attempting graceful shutdown of VM...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
systemctl stop etcd
ifconfig 10.10.10.10 netmask 255.255.255.0
mv /tmp/etcd-cluster.service /media/state/units/
systemctl restart local-enable.service
# Restart default etcd
systemctl start etcd
Stdout from the command:
Stderr from the command:
bash: line 3: systemctl: command not found
SIOCSIFNETMASK: No such device
SIOCGIFADDR: No such device
SIOCSIFBROADCAST: No such device
mv: cannot move `/tmp/etcd-cluster.service' to `/media/state/units/': No such file or directory
bash: line 6: systemctl: command not found
bash: line 9: systemctl: command not found

Not sure if this was the cause, but the culprit could have been SELinux. Maybe it blocked connections or permissions. Got it working later:
setenforce Permissive
nano /etc/sysconfig/selinux
#setting SELINUX=disabled

Related

Minikube: Unable to start minikube - Exiting due to DRV_NO_IP:

I am trying to create the minikube cluster, but It always fails.
Any suggestions are very welcome:
C:\WINDOWS\system32>minikube start --driver=vmware
minikube v1.16.0 on Microsoft Windows 10 Home 10.0.19042 Build 19042
Using the vmware driver based on user configuration
Starting control plane node minikube in cluster minikube
Creating vmware VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
Deleting "minikube" in vmware ...
! StartHost failed, but will try again: creating host: create: Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting
Creating vmware VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
Failed to start vmware VM. Running "minikube delete" may fix it: creating host: create: Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting
X Exiting due to DRV_NO_IP: Failed to start host: creating host: create: Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting
Suggestion: Check your firewall rules for interference, and run 'virt-host-validate' to check for KVM configuration issues. If you are running minikube within a VM, consider using --driver=none
Documentation: https://minikube.sigs.k8s.io/docs/reference/drivers/kvm2/
Related issues:
https://github.com/kubernetes/minikube/issues/4249
https://github.com/kubernetes/minikube/issues/3566
I had a similar error when setting up Minikube on Mac OS.
When I run the command minikube start I get the error below:
😄 minikube v1.22.0 on Darwin 11.4
✨ Using the vmware driver based on existing profile
👍 Starting control plane node minikube in cluster minikube
🏃 Updating the running vmware "minikube" VM ...
🤦 StartHost failed, but will try again: provision: IP not found for MAC 00:0c:29:41:e9:b9 in DHCP leases
🏃 Updating the running vmware "minikube" VM ...
😿 Failed to start vmware VM. Running "minikube delete" may fix it: provision: IP not found for MAC 00:0c:29:41:e9:b9 in DHCP leases
❌ Exiting due to GUEST_PROVISION: Failed to start host: provision: IP not found for MAC 00:0c:29:41:e9:b9 in DHCP leases
The issue was caused by an interruption when I was creating the VMWare VM for Minikube.
I tried fixing it by deleting the existing minikube vm and creating another one using:
minikube delete
minikube start
But then I ran into another issue this time:
Exiting due to DRV_NO_IP: Failed to start host: creating host: create: Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting.
Here's how I fixed it
After multiple research, it's just best to set up minikube with docker driver which will save you all this hassle.
For Mac OS:
If you already have docker installed or docker-compose simply uninstall it using:
brew uninstall docker
brew uninstall docker-compose
Next, install Docker desktop. This will install Docker/Docker Desktop, Docker-compose and other dependencies using:
brew install --cask docker
Next, start the docker engine by opening the Docker application. Afterwhich you can confirm the docker version using:
docker --version
Finally, setup minikube using docker driver:
minikube start --driver=docker

When I run sudo minikube start --vm-driver=none it gives me error

When I run sudo minikube start --vm-driver=none it gives me this error and I am using Ubuntu 16.0.4.
Error starting cluster: cmd failed: sudo env PATH=/var/lib/minikube/binaries/v1.16.2:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap
: running command: sudo env PATH=/var/lib/minikube/binaries/v1.16.2:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap
output: [init] Using Kubernetes version: v1.16.2
[preflight] Running pre-flight checks
[WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
[WARNING Swap]: running with swap on is not supported. Please disable swap
[WARNING FileExisting-ebtables]: ebtables not found in system path
[WARNING FileExisting-socat]: socat not found in system path
[WARNING SystemVerification]: this Docker version is not on the list of validated versions: 19.03.4. Latest validated version: 18.09
[WARNING Hostname]: hostname "minikube" could not be reached
[WARNING Hostname]: hostname "minikube": lookup minikube on 127.0.1.1:53: no such host
[WARNING Service-Kubelet]: kubelet service is not enabled, please run 'systemctl enable kubelet.service'
[WARNING Port-10250]: Port 10250 is in use
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR Port-10251]: Port 10251 is in use
[ERROR Port-10252]: Port 10252 is in use
[ERROR Port-2380]: Port 2380 is in use
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher
: running command: sudo env PATH=/var/lib/minikube/binaries/v1.16.2:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap
.: exit status 1
The none driver makes a lot of assumptions that would normally be handled by the VM setup process used by all other drivers. In this case you can see that some of the ports it expects to use are already in use so it won't continue. You would need to remove whatever is using those ports. The none driver is generally used for very niche situations, almost always in an ephemeral CI environment, though maybe also check out KinD as a newer tool that might address that use case better. If you just want to run a local dev environment on Linux without an intermediary VM, maybe try k3s or microk8s instead.
In the documentation there is a note about the need of having these ports free. You need to sort it out what is using them to get rid of these errors:
[WARNING Port-10250]: Port 10250 is in use
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR Port-10251]: Port 10251 is in use
[ERROR Port-10252]: Port 10252 is in use
[ERROR Port-2380]: Port 2380 is in use
This is preventing you system to load and it's described on the documentation. To investigate you can use the following command:
$ sudo lsof -i :10251
If you don't have this command installed you can install it using:
$ sudo apt-get install lsof
Running minikube with --vm-driver=none is possible but not recommended. By using none Driver, you have decreased reliability, decreased security, risk of data loss and more. Refer to documentation for more details.
There is an issue opened to address these security problems.
Full list of open ‘none’ driver issues
The best way of doing it on Linux is using kvm. To accomplish that you can follow these instructions (assuming you have Docker CE installed):
$ sudo apt-get install -y qemu-kvm libvirt-clients libvirt-daemon-system
$ sudo adduser $USER libvirt
And run minikube with kvm2 driver:
$ minikube start --vm-driver kvm2 --kubernetes-version v1.15.0

vagrant up failed my centos 4.1 i386 box

vagrant up failed
here is my "Vagrantfile"
#-*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION="2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "centos41build"
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--cpus", "1", "--memory", "1024"]
vb.gui = false
end
config.vm.define :centostest41 do |centostest41|
centostest41.vm.network "private_network", ip: "192.168.10.10"
centostest41.vm.hostname = "centosfivefour"
## ssh
centostest41.vm.network :forwarded_port, guest: 22, host: 2105
end
end
that is fail messages
$ vagrant up
Bringing machine 'centostest41' up with 'virtualbox' provider...
==> centostest41: Clearing any previously set forwarded ports...
==> centostest41: Fixed port collision for 22 => 2222. Now on port 2203.
==> centostest41: Clearing any previously set network interfaces...
==> centostest41: Preparing network interfaces based on configuration...
centostest41: Adapter 1: nat
centostest41: Adapter 2: hostonly
==> centostest41: Forwarding ports...
centostest41: 22 => 2105 (adapter 1)
centostest41: 22 => 2203 (adapter 1)
==> centostest41: Running 'pre-boot' VM customizations...
==> centostest41: Booting VM...
==> centostest41: Waiting for machine to boot. This may take a few minutes...
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'poweroff' state. Please verify everything is configured
properly and try again.
If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run `vagrant up` while the
VirtualBox GUI is open.
The primary issue for this error is that the provider you're using
is not properly configured. This is very rarely a Vagrant issue.
this box made in myself by centos4.1i386 virtualbox
how to solve this problem?
i was search this issue. but i can't solve.... gui config -> false solution is failed
this error get when i give to vagrant debug option
INFO interface: error: The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'poweroff' state. Please verify everything is configured
properly and try again.
If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run vagrant up while the
VirtualBox GUI is open.
The primary issue for this error is that the provider you're using
is not properly configured. This is very rarely a Vagrant issue.
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'poweroff' state. Please verify everything is configured
properly and try again.
If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run vagrant up while the
VirtualBox GUI is open.
The primary issue for this error is that the provider you're using
is not properly configured. This is very rarely a Vagrant issue.
INFO interface: Machine: error-exit ["Vagrant::Errors::VMBootBadState", "The guest machine entered an invalid state while waiting for it\nto boot. Valid states are 'starting, running'. The machine is in the\n'poweroff' state. Please verify everything is configured\nproperly and try again.\n\nIf the provider you're using has a GUI that comes with it,\nit is often helpful to open that and watch the machine, since the\nGUI often has more helpful error messages than Vagrant can retrieve.\nFor example, if you're using VirtualBox, run vagrant up while the\nVirtualBox GUI is open.\n\nThe primary issue for this error is that the provider you're using\nis not properly configured. This is very rarely a Vagrant issue."]

Libvirt Connect to XEN from Windows

I have setup XEN on SLES12 and created few virtual machines. Using virsh I am able to connect to libvirt from linux but not from windows. I was trying:
# connect xen://hostname
# connect xen://hostname/system
# connect xen+tcp://hostname
# connect xen+tcp://hostname/system
I have recieved following error messages:
# connect xen+tcp://hostname 'Unable to connect to server at 'hostname:16509': Unknown error 107'
# connect xen://hostname 'error: Cannot read CA certificate '/usr/i686-w64-mingw32/sys-root/mingw/etc/pki/CA/cacert.pem': No such file or directory'
Other commands stated above produce same errors. I runned netstat and I cannot find port number 16509. I assume that when I connect from linux it uses different port(?) as there is no problem with that. the only difference is that from linux I use ssh connection:
# connect xen+ssh://root#hostname
Any ideas will be appriciated
It’s likely that your libvirtd is not listening to the TCP port. You must have –listen option while running the libvirtd.
Check following link
Additionally you may need to modify /etc/libvirt/libvirtd.conf
listen_tls = 0 #it's enabled by default. To disable it, set it to be zero
listen_tcp = 1
tcp_port="16509"
listen_addr="192.168.45.22"
# tcp_auth = "sasl"
auth_tcp = "none"
# /usr/sbin/libvirtd –listen
Use command libvirtd -d
It will create libvirtd deamon
and then use libvirtd --listen to make libvirtd listen on TCP port.

Centos and Fedora Docker, I can not start mysql

I am new on centos, I was in Ubuntu and my friend "yograterol convinced me to go over to Fedora was the best.
Change many things, the problem is that mysql does not start in docker, in my local fedora was the same, but in Docker did not work, no commands are:
# mysql
ERROR 2002 (HY000): Can not connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Local fix it as follows:
$ sudo setenforce 0
$ sudo service mysqld start
But in Docker, out the following:
# setenforce 0
bash: setenforce: command not found
# Service mysqld start
bash: service: command not found
It happens in the Docker: Centos and Fedora.
I think it's because they are minimum operating system images.
Have you tried running only mysqld ?
Invoke mysqld directly. This works on any platform.