selivan/thinclient

Test VM: Kernel panic - not syncing: Attempted to kill init!! exitcode=0x00000200

ILTB opened this issue · 13 comments

ILTB commented

Vagrant 2.1.5
VB 5.2.18 r124319 (Qt5.6.2)
Template VM: Linux ubuntu-xenial 4.4.0-137-generic #163-Ubuntu SMP Mon Sep 24 13:14:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

How to fix it?

I just followed instructions in https://github.com/selivan/thinclient/blob/master/README.md and got successful boot to GUI on test machine. Tested with:

  • Vagrant 2.0.1
  • VirtualBox 5.2.18

Could you please write how you got the error step-by-step?

Kernel panic - not syncing: Attempted to kill init means that something went wrong inside initrd. You may add parameter initrddebug=y to pxelinux.cfg and look inside what is wrong(see https://github.com/selivan/thinclient/blob/master/docs/INTERNALS.md).

ILTB commented

Okey.

  1. Download and install last version Vagrant
  2. Download and install last version VirtualBox
  3. Reboot PC
  4. Download sources thinclient in zip archive, and unpack to disk D:\Vagrant\
  5. Run CMD and go to path "cd /d D:\Vagrant\thinclient"
  6. vagrant up template (no errors)
  7. vagrant up server (no errors)
  8. vagrant reload template
  9. vagrant ssh template
  10. Run on template VM: cd / > cd vagrant > ./build.sh all
  11. vagrant up test (no errors)
  12. shutdown test VM on VirtualBox
  13. Del on test vm scsi disks
  14. Run test VM on VirtualBox
ILTB commented

Ohhhh sorry, im made a mistake in the first message.
Kernel panic on TEST VM!

  1. vagrant up test (no errors)

That's weird. Test machine has modified network settings to boot from network and vargant can't connect to it. The machine should boot up from network, but this command should end with error.

I can't reproduce your problem because I don't have any Windows around. Let's try to check if problem is in environment or in build itself. Here is my build: https://yadi.sk/d/fBbY53LRfu0mQw Try to place this files in D:\Vagrant\thinclient\build. Rename vmlinuz-4.15.0-36-generic and initrd.img-4.15.0-36-generic to vmlinuz and initrd. Try to run TEST machine(from Virtualbox, not from Vagrant - it messes up first network interface settings), see if problem reproduces with my build.

BTW, I just figured out, that Windows build may fail because it does not support symlinks inside build folder. But again, no Windows around to check that.

ILTB commented

Console logs and image build folder.
logs.zip

ILTB commented
  1. Replaced your files and renamed. It started! (symlink deleted)
  2. Replaced my files and renamed. Not start! (symlink deleted)
TASK [Gathering Facts] *********************************************************
fatal: [template]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '192.168.10.253' (ECDSA) to the list of known ho
sts.\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@\r\nPermissions 0777 for '/vagrant/.vagrant/machines/template/virtualbox/private_key' are too open.\r\nIt is required that your private key files are NOT acces
sible by others.\r\nThis private key will be ignored.\r\nLoad key \"/vagrant/.vagrant/machines/template/virtualbox/private_key\": bad permissions\r\nPermission denied (publicke
y).\r\n", "unreachable": true}
        to retry, use: --limit @/vagrant/provision.retry

Here it is. Provision failed, because permissions in VirtualBox shared directory on Windows are broken.

I changed provision.yml to fix that in 2acbe77. I am not sure that it will work in shared VirtualBox directory on Windows. Please run git pull to get this fix. Then run provision again to configure template machine(it is done from server to avoid installing ansible on template):

vagrant provision server

Then you can start build process again from template machine:

vagrant ssh template
cd /vagrant; ./build.sh all

ILTB commented
TASK [Gathering Facts] *********************************************************
fatal: [template]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '192.168.10.253' (ECDSA) to the list of known hosts.\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nPermissions 0777 for '/vagrant/.vagrant/machines/template/virtualbox/private_key' are too open.\r\nIt is required that your private key files are NOT accessible by others.\r\nThis private key will be ignored.\r\nLoad key \"/vagrant/.vagrant/machines/template/virtualbox/private_key\": bad permissions\r\nPermission denied (publickey).\r\n", "unreachable": true}
        to retry, use: --limit @/vagrant/provision.retry

PLAY RECAP *********************************************************************
server                     : ok=16   changed=0    unreachable=0    failed=0
template                   : ok=0    changed=0    unreachable=1    failed=0

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

OK, second try to fix it: 5311b92

Same steps:

git pull
vagrant provision server
vagrant ssh template
cd /vagrant; ./build.sh all

ILTB commented
TASK [Gathering Facts] *********************************************************
fatal: [template]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '192.168.10.253' (ECDSA) to the list of known hosts.\r\nno such identity: /root/template_private_key: Permission denied\r\nPermission denied (publickey).\r\n", "unreachable": true}
        to retry, use: --limit @/vagrant/provision.retry

PLAY RECAP *********************************************************************
server                     : ok=16   changed=1    unreachable=0    failed=0
template                   : ok=0    changed=0    unreachable=1    failed=0

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

Third try: d1bd40d Works for me, but I'm on Linux

P.S. If it does not work again, could you please post the whole provision log, not just the failed part? It's convenient to use gist for long files.

ILTB commented

It's working! Thx you!

@ILTB You are welcome :)