Archive April 2015

access to a dockerized apache from local mochine

Get ubuntu

docker pull ubuntu:vivid

Start ubuntu container

docker run -ti ubuntu:vivid /bin/bash

Install apache

root@54a954be4ca3:/# apt-get install apache2

Type CTRL+P then CTRL+Q : this will exit the shell without killing the process
Now in the local machine, check out the container name

docker ps

Save the container with its apache installed (suppose your container name is happy_pasteur)

docker commit -a “witr ” -m “install apache2” happy_pasteur witr/myapache

Stop the container

docker stop happy_pasteur

Start apache in new container “myapache” and bind ports

docker run -d -p 9999:80 witr/myapache /usr/sbin/apache2ctl -D FOREGROUND

Finally browse http://localhost:9999

VT-x is being used by another hypervisor .. Please disable the KVM

while starting my VM using vagrant, I have following 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.

So, I edit my Vagrantfile and uncomment gui

   config.vm.provider "virtualbox" do |vb|
     vb.gui = true
   end

Then I start my vm using VirtualBox. I have the following error :
VT-x is being used by another hypervisor … Please disable the KVM

what to do ?
1. see if kvm is running and is used

witr@serv:~$ lsmod | grep kvm
kvm_intel 143592 3
kvm 459835 1 kvm_intel

here kvm is used by one consumer (kvm_intel) and kvm_intel is used by 3 consumers.

2. stop kvm consumers
In my case it’s the android emulator i have launched from AndroidStudio which causes problem. I stop emulator.

3. restart vm
that’s all