non-Vagrant environment on Free AWS maybe?

Hi,
Is there any way to setup a non-Vagrant environment, like maybe in the Free AWS?
On my laptop, I have Windows 10 Home Edition only and I can’t turn on HyperV unless I upgrade to Windows 10 PRO although the laptop itself I can turn turn on virtualization on the BIOS.
I am trying to partition it and install Ubuntu to a new partition hope that works alright.
Anyway, here’s hoping for an alternative of some sort.

I appreciate all the efforts @Edwin_49627. You can continue with the course, but for labs, there is no alternative than Vagrant / Ubuntu.

Let me know the progress and if I can help.

Kanika

Hi Kanika,

Managed to get Vagrant / Virtual Box finally running on Windows 10 Home. Can’t used the Windows 10 Pro with Vagrant and Virtual Box. From Google, it says has to turn off Hyper-V but I can’t do that as the laptop is owned by the customer.

Can I get an extension to finishing the lab as I lost a couple of days trying to setup the lab?
I think I have a day left to finish the first chapter’s lab. I am almost finish but can’t tell.

Great!! :partying_face:

I am afraid not.! :frowning: Let me know if you need help.

Kanika

Don’t need help atm, more time is what I needed. I’ll see how things goes.

hey Edwin,

I’m having the same problem how did you partition Ubuntu to get everything to work.
can you forward me to a link or something that would be great

Hi Isaac,

I ended up not having to do so. Turns out, I don’t need Hyper-V and Windows 10 PRO. I managed to get Vagrant and Virtual Box on a Windows 10 HOME but out of curiosity in case anyone have a need for it. I did go ahead and experimented with alternatives. I would have gone Docker but Docker does not work on Windows 10 HOME.

It would be nice if the Open Source Community have HOME Edition as the minimum requirement for open source products :slight_smile:

My problem is that I have laptops that have differing problems like below;

  • Laptop 1 Hyper-V is enabled
  • Laptop 2 is on Windows10 HOME

So in the end, with the help of a colleague, I ended up experimenting several scenarios and I managed to get the lab working without having to install Vagrant and VirtualBox or having Virtual Box and Vagrant on Windows etc. This is what I did for the M103 course but unfortunately NOT on the Free Tier because I need 4G of RAM and 10G of space. If you have a grunty enough computer you can just simply use Virtual Box.

According to someone that I am communication with at MongoDB, someone from the MongoDB University Team is supposed to provide me how to do the AWS build for doing the course. But 3 weeks down the line, nothing happens so I started Googling and got hooked into trying alternatives.

Below is what I’ve experimented on that’s working

  1. MongoDB University M103 using AWS and Ubuntu 16 Server
  2. MongoDB University M103 using Virtual Box and Ubuntu 14 Desktop

Below is what I did for AWS, unfortunately, like I said, it is not on a free tier one. Managed to source out a non-free one but has to stop it when not in use and the steps I have here is for the M103 that am still way behind on and the University is not giving me an extension of and it’s the Easter Holiday :cry:

Without further ado, here’s what I did

MongoDB University M103 using AWS and Ubuntu 16 Server

  1. Login to AWS Console, Create/Launch EC2 Instance and choose Ubuntu Server 14.04 LTS (HVM), SSD Volume Type. You will need a ssh key-pair to be able to do step 2 and continuer. I used the following:
  • Instance Type = t2.medium
  • Storage = 10G
  1. Presumably you know how to set it up so you can test connection via ssh. I can’t recommend the same settings here as what I did is relevant to the account that I use. All that’s important is that you are able to ssh to the AWS instance. And then continue with the rest of the steps below.

  2. ssh to your AWS Instance and then do

sudo su -
groupadd vagrant
useradd -m -d /home/vagrant -g vagrant -G sudo vagrant

mkdir /dataset /shared /var/m103

chown vagrant:vagrant /dataset /shared /var/m103

visudo and change
%sudo ALL=(ALL:ALL) ALL
To
%sudo ALL=(ALL) NOPASSWD:ALL

  1. Download and unzip the course material. Hopefully this is not blocked in your AWS Instance build, so far, on my instance, it just works fine. Not sure if this is an AWS issue if it doesn’t work or someone from your company to check on if you are using a company AWS console account.

su - vagrant
wget https://s3.amazonaws.com/edu-downloads.10gen.com/M103_2019_April/static/handouts/m103/m103-vagrant-env.zip

unzip m103-vagrant-env.zip
chmod +x provision*
sudo ./provision* - whatever is the provision filename

NOTE:
When I ran it, it just seems like it is not doing anything. Type in exit in the next prompt and it will actually do the build/download stuff. You will get some error with regards to 198.162.103.100. Ignore that for the time being.

$ sudo ./provision-mongod

  • config
  • sudo su

After this step, you should at the very least be able to run mongod

  1. To ‘fix’ the 192.168.103.100 error. I have to make changes to the /etc/network/interfaces file and added the following lines. verify_ip of the provision-mongod checks for this IP address, so the error is due to ifconfig failing and can’t find this IP addresss.

auto eth0:1
iface eth0:1 inet static
address 192.168.103.100

  • Restart the network running one of the commands below or better yet just re-start the EC2 Instance. You don’t need to run both, I listed both 'coz some Ubuntu flavours doesn’t have one or the other

sudo systemctl restart networking
sudo service network-manager restart

  1. Now, re-run the provision-mongod and you should not have the same 192.168.103.100 error anymore. Don’t forget to type exit for the script to actually do something :slight_smile:

$ sudo ./provision-mongod

  • config
  • sudo su
  1. Test running mongod, mongo and validate_box. Validation scripts are in /var/m103/validations.

NOTE:
I also tested using validate_box. I didn’t do the rest of the lab using this build as I am able to get them to work on Windows 10 HOME.

MongoDB University M103 using Virtual Box and Ubuntu 14 Desktop

NOTE:
I assume you know how to use Virtual Box. Just need the basics really. I am lost on how to use it too especially when it comes to nesting Virtual Boxes.

  1. Obviously the first step is to download the ISO. I downloaded ubuntu-14.04.6-desktop-amd64.iso and ubuntu-14.04.6-server-amd64.iso just in case.

  2. Create a new virtual machine with the same 4-GB RAM and 10G disk space. Choose the ubuntu-14.04.6-desktop-amd64.iso to boot and go along with the flow and choose the defaults. Obviously you want to make sure you use the right disk file in case you have several Virtual Boxes.

  3. After the build, check that you are able to access the internet etc.

  4. Open a terminal and do the following:

sudo su -
groupadd vagrant
useradd -m -d /home/vagrant -g vagrant -G sudo vagrant

mkdir /dataset /shared /var/m103

chown vagrant:vagrant /dataset /shared /var/m103

visudo and change
%sudo ALL=(ALL:ALL) ALL
To
%sudo ALL=(ALL) NOPASSWD:ALL

  1. Download and unzip the course material.

su - vagrant
wget https://s3.amazonaws.com/edu-downloads.10gen.com/M103_2019_April/static/handouts/m103/m103-vagrant-env.zip

unzip m103-vagrant-env.zip
chmod +x provision*
sudo ./provision* - whatever is the provision filename

NOTE:
When I ran it, it just seems like it is not doing anything. Type in exit in the next prompt and it will actually do the build/download stuff. You will get some error with regards to 198.162.103.100. Ignore that for the time being.

$ sudo ./provision-mongod

  • config
  • sudo su

After this step, you should at the very least be able to run mongod

  1. To ‘fix’ the 192.168.103.100 error. I have to make changes to the /etc/network/interfaces file. verify_ip of the provision-mongod checks for this IP address, so the error is due to ifconfig failing and can’t find this IP addresss. Below is what the /etc/network/interfaces file after my changes.

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

# - Added for M103, verify_ip / ifconfig searches for 192.168.103.100
auto eth0:1
iface eth0:1 inet static
address 192.168.103.100
netmask 255.255.255.0

# Source interfaces
# Please check /etc/network/interfaces.d before changing this file
# as interfaces may have been defined in /etc/network/interfaces.d
# See LP: #1262951
source /etc/network/interfaces.d/*.cfg

  • Check that you have a file named /etc/network/interfaces.d/eth0.cfg too. Create one if you don’t have any. This file should have the following

# The primary network interface
auto eth0
iface eth0 inet dhcp

  • Restart the network running one of the commands below although in most cases, both doesn’t really fix the 192.168.103.100 problem and I ended just having to restart

sudo systemctl restart networking
sudo service network-manager restart

  1. Now, re-run the provision-mongod and you should not have the same 192.168.103.100 error anymore. Don’t forget to type exit for the script to actually do something :slight_smile:

$ sudo ./provision-mongod

  • config
  • sudo su
  1. Test running mongod, mongo and validate_box. Validation scripts are in /var/m103/validations.

NOTE:
I also tested using validate_box. I didn’t do the rest of the lab using this build as I am able to get them to work on Windows 10 HOME.

Finally, FYI below is the Ubuntu flavour as per the release files:

  • AWS with Ubuntu Server
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=16.04
    DISTRIB_CODENAME=xenial
    DISTRIB_DESCRIPTION=“Ubuntu 16.04.5 LTS”

  • Ubuntu Desktop on Virtual Box
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=14.04
    DISTRIB_CODENAME=trusty
    DISTRIB_DESCRIPTION=“Ubuntu 14.04.6 LTS”

I tried Ubuntu 18 on Virtual Box, the provision script doesn’t like it. I am not sure if the AWS free tier will work. I don’t think it has enough free for it to work especially the memory.

Good luck. Hope this helps you or anyone else who are not able to use Vagrant and Virtual Box on Windoze (sic) I mean Windows. I was hoping by now, Microsoft will be shouting free upgrade for all Windows 10 Home users :slight_smile:

I hope my badge gets upgraded after this post

2 Likes

Okay, I have just tried the free -tier using the same steps

I chose

Ubuntu Server 14.04 LTS (HVM), SSD Volume Type - ami-001dae151248753a2
t2.micro

I have to install unzip which I didn’t have to do before.

apt -y install unzip

Because I know I have to, I made the changes to the /etc/network/interfaces file first before running provision-mongod

I am not able to start mongod, mongo and run validate_box.
Not sure if it will be grunty enough to finish the rest of the course especially when it comes to sharding, replication etc.

Have fun.