bradleyd / devops_for_the_desperate

The companion code for the book DevOps for the Desperate
111 stars 62 forks source link

Can't Get Past Chapter 1 - Please Help! #30

Closed drdexter33 closed 1 week ago

drdexter33 commented 11 months ago

I recently bought the book DevOps for the Desparate and cannot get past chapter 1 exercises and I've gone through the exercises multiple times now.

Per the introduction instructions on page xiv:

I am running the examples in a Windows 11 Pro - Hyper - V Ubuntu VM. I've tried the following OS's

  1. Ubuntu 18.04 LTS
  2. Ubuntu 20.04 LTS
  3. Ubuntu 22.04 LTS

image

(Not in the instructions) When the Hyper-V image is created, I resized the hard drive to 100GB in Hyper-V setting since I was running out of space when I ran $vagrant up

After I resized the hard drive in Hyper-V I also needed to resize the Linux partition which I did.

image

All of the other steps I completed successfully, IE:

Page xiv Set-VMProcessor -VMName 'Ubuntu 20.04 LTS' -ExposeVirtualizationExtensions $true

Page xxi $git clone https://github.com/bradleyd/devops_for_the_desperate/

Page 4 Installed Vagrant

Page 7 Installed Ansible

Page 9 '$ vagrant up'

I've been getting different errors, but now I am getting this one:

$ vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing base box 'ubuntu/focal64'... ==> default: Matching MAC address for NAT networking... ==> default: Checking if box 'ubuntu/focal64' version '20230719.0.0' is up to date... ==> default: Setting the name of the VM: dftd ==> default: Clearing any previously set network interfaces... **There was an error while executing VBoxManage, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "ipconfig", "vboxnet2", "--ip", "172.28.128.1", "--netmask", "255.255.255.0"]

Stderr: VBoxManage: error: Code E_ACCESSDENIED (0x80070005) - Access denied (extended info not available) VBoxManage: error: Context: "EnableStaticIPConfig(Bstr(pszIp).raw(), Bstr(pszNetmask).raw())" at line 242 of file VBoxManageHostonly.cpp**

I can't move on to the next chapter since evertything from this point is dependent on getting this set up correctly.

PS: There is a VM in VirtualBox, but I don't think it's working:

image

drdexter33 commented 11 months ago

I've even tried to create a new VirtualBox VM without the vagrantfile in the Hyper-V VM and am not having any success.

drdexter33 commented 11 months ago

Tried again and for some reason it's hanging here:

==> default: Mounting shared folders... **default: /vagrant => /home/user/devops_for_the_desperate/vagrant**

drdexter33 commented 11 months ago

Ran vagrant up --debug

DEBUG ssh: Re-using SSH connection. INFO ssh: Execute: id -u vagrant (sudo=false) DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh DEBUG ssh: Exit status: 0 DEBUG ssh: Re-using SSH connection. INFO ssh: Execute: getent group vagrant (sudo=false) DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh DEBUG ssh: Exit status: 0 DEBUG ssh: Re-using SSH connection. INFO ssh: Execute: mkdir -p /vagrant (sudo=true) DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh DEBUG ssh: Exit status: 0 DEBUG ssh: Re-using SSH connection. INFO ssh: Execute: mount -t vboxsf -o uid=1000,gid=1000,_netdev vagrant /vagrant (sudo=true) DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh DEBUG ssh: Sending SSH keep-alive... DEBUG ssh: Sending SSH keep-alive... DEBUG ssh: Sending SSH keep-alive...

davincent commented 11 months ago

I am also having similar issues. I have had more success with Ubuntu 20.04 LTS and VirtualBox v6.1. What versions are you using?

drdexter33 commented 11 months ago

22.04 LTS VB 6.1

drdexter33 commented 11 months ago

We can't be the only ones running into issues

drdexter33 commented 11 months ago

image

davincent commented 11 months ago

You'll need to use Ubuntu 20.04. Vagrant had an issue with 22.04. I didn't screenshot the message unfortunately.

drdexter33 commented 11 months ago

Did you get yours to work?

drdexter33 commented 11 months ago

Dropped down to 20.04.

Now getting this: image

davincent commented 11 months ago

I did manage to get mine to work. But I noticed I had to be in the vagrant directory and use 'sudo vagrant up'. Don't forget to install ansible.

bradleyd commented 9 months ago

Just checking in, is the issue resolved?

drdexter33 commented 9 months ago

No...I kind of gave up on it and moved on.. Could never get it to work... It would just hang

bradleyd commented 9 months ago

That stinks.

I noticed the use of sudo on vagrant up. This should never be used as it will change the .vagrant files to be owned by root.

Just to be clear, you installed virtualbox and vagrant in the ubuntu 20.04 vm running in hyper-v, correct?

@drdexter33 the error you are seeing is most likely the remnants of the failed virtualbox runs. If I recall, because of the failed up's (possibly with sudo) there is network interfaces in virtualbox that need to be removed. Go into the tools menu and remove any interfaces/networks.

You might want to do a sudo rm -rf .virtualbox (I think that is the name of the dir?) and devops_for_the_desperate/vagrant/.vagrant directory as well to get a clean slate.

Just use Ubuntu 20.04 since Vagrant had issues with 22.04, maybe fixed by now?

I really hope this helps you get passed Chapter 1. There is so much more interesting tasks in the later chapters.

davincent commented 9 months ago

I had a feeling sudo wasn't the intended method. I'll go through it again from the beginning to figure were I went wrong. I appreciate the feedback.

bradleyd commented 1 week ago

Please reopen if you need help.