Vagrant alternative to Amazon Linux - linux

My company has decided to migrate our base server images from Ubuntu Server to Amazon Linux. In the past we would spin up an Ubuntu Server LTS box from vagrantbox.es to emulate an instance in our AWS stack, but Amazon only provides an AMI.
According to the Amazon Linux AMI FAQ, updates are custom tailored depending on the EC2 region the AMI is launched in, which might have issues with exporting an AMI to VDI. I've also read that Amazon Linux removes a lot of cruft from RHEL and Fedora to make it a server-optimized distribution.
How can I emulate Amazon Linux in an environment where I might not have a persistent network connection?
Apart from switching to yum, what pitfalls should I expect in running Amazon Linux locally?
Is there some pre-built vagrant box for Amazon Linux that gets around these pitfalls?

Amazon does not provide an image of its distribution for use on other VM platforms. You may find these blog posts useful though; they provide detailed instructions for building Amazon Linux disk images, and in the last article he provides direct links to images he built for VMWare and VirtualBox.
Amazon Linux is based on CentOS so you could also start there.

Related

Is running a Linux container on windows AWS instance possible?

I'm trying to run a Linux (ubuntu LTS) container inside a windows server 2019 OS. The problem is that the windows OS runs as an AWS instance.
There have been problem for me trying to achieve this and I've been reading somewhat different opinions on the internet regarding whether or not it is possible. Some say it will be possible on a .metal instance which is bare metal. Currently I've been trying running it on a regular t3 instance with has virtualization type HVM.
To sum up my questions are:
Is running a linux container on windows aws instance possible?
If yes, how?
If not, will it be possible on a bare metal instance?
Please keep in mind that I need the container to run in a Windows environment due to multiple tasks the the OS needs to achieve (and I don't want multiple instances)
In order to use Docker Desktop on Windows, you need either Hyper-V or Windows Susbsystem for Linux enabled (which at its turn requires Hyper-V). Both solutions demand of VT-x capabilities, but you're running inside a VM, which means that is not so easy to achieve.
It is called "nested virtualization", and it is not supported in common EC2 virtual machines. (source)
You can certainly run Linux containers on a bare metal Windows instance (but why you should? it is way cheaper and simpler to create a Linux virtual machine on EC2 and communicate it with your Windows host). Should still that be your purpose, you can install Windows Server 2019 with Hyper-V. (tutorial)
Another alternative for SMALL, SMALL things, that could work without nested virtualization (I haven't tried), would be using WSL1. (more info)
WSL1 uses a compatibility layer between Windows and Linux system calls, without actually virtualizing the operating system. Some folks have been able to install Docker 17.09 on WSL1, but this is a very adventurous path I would not recommend taking.

Create a new service in Amazon Linux

I have an Amazon ec2 instance running Amazon Linux AMI 2018.03. I would like to create a startup service but I can't use systemctl as I'm not on Amazon Linux 2.
The service is a Python script that I would like to run at startup and be able to start/stop. How would I do this?
Amazon Linux 1 is using sysvinit system, unlike systemd in Amazon Linux 2. One way of setting it up to manage your service is shown here.
However, Amazon Linux 1 has only few months left of its lifetime:
Update on Amazon Linux AMI end-of-life
Thus if you can, please consider using Amazon Linux 2. Sooner or later you will have to switch to AL2 anyway for security reasons, so may try doing this now.

New Custom centos boot disk with parameters from official google cloud setting

I want to change the root filesystem CentOs 6 to Btrfs filesystem.
My solution is to export virtual machine from localhost to GCE, I know the documentation to this job, but I have doubts how does work the process the import of boot disk images (You can import boot disk images from your physical datacenters, from virtual machines on your local workstation, or from virtual machines that run on another cloud platform. )
My question is relation to documenation of https://cloud.google.com/compute/docs/images:
Notable differences from standard CentOS images
Google Compute Engine-provided CentOS images contain the following differences from standard CentOS images:
All packages are updated to the date of the image and the image will reflect the latest CentOS point release.
Google Cloud repositories are enabled to install packages from the Linux Guest Environment for Google Compute Engine.
Google CloudSDK is installed.
IPv6 is disabled as it is not yet supported on Compute Engine.
The eth0 MTU is set to 1460.
DHCP is set to retry every 10 seconds instead of 5 minutes.
The DHCP client is set to persistent mode instead of oneshot.
......
......
......
So my question is, ¿when I imported a boot disk CentOs from my computer to GCE, does GCE apply all this parameters to my boot disk CentOs, so To be compatible with the standard settings of google image CentOs?
If this does not, then:
¿How can i proceed?
I find the solution:
There is a free service that helps with VM migrations but is limited to some OS. CentOS 6.0 is included but I am not sure if it supports the file system you are looking for.
If you cannot use the migration service and you do not want to use the public images provided by Google, then you must take care of the bootloader and all OS configuration you mentioned. You might also want to have a look to this link, in public Google images some daemons are installed by default. They add GCE functionality like syncing the accounts used in your project with the VMs.

amazon web service -EC2 linux vm has no graphics card or shared graphics

I am not sure if amazon simply does not offer graphics for linux vm instances or if its to do with configuration. But i recently setup a linux node on ec2 and i tried to setup rdp. I kept getting a blank screen but after much trial and error, went with bizspark and setup a linux node and to my surprise I see the bizspark linux node comes with a vga graphics card! while the amazon one does not!
Without a vga graphics card or builtin chipset its not possible to rdp in the linux node.
So does amazon offer graphics card on linux vms or is it a simply a matter of configuration ?
edit:
It is possible to have rdp even without a graphic card apparently. What I found out is one can install X2GO server on their ubuntu server and then just get the x2go client. No need for rdp.
If you'd like to get RDP working on EC2, take a look here:
http://michaelhallsmoore.com/blog/Desktop-Ubuntu-in-Amazon-EC2-The-Right-Way
or
http://activeintelligence.org/blog/archive/remote-graphical-linux-desktop-on-ec2/
You don't actually need a video card.

Amazon EC2 Image with VNC enabled?

I want to fire up an linux EC2 instance that has VNC installed by default. Something like Ubuntu, where I can fire up, and VNC right in to configure.
I've observed all of the AMI's that are available, and the closest thing I can come to, is:
SuSE Linux Enterprise Server 11 sp3 (HVM) - ami-xxxxxxx
SuSE Linux Enterprise Server 11 Service Pack 3 (HVM), EBS-backed. Nvidia driver installs automatically during startup for GPU instances.
I assume that this has graphic capabilities, but you know what they say about assumptions.
Does anybody know of an image that has this? I just want to fire up an instance that I can get right into, not through SSH.
The images you are looking at are designed for the largest (HVM) instances. The second one is intended for GPU instances. Probably not what you are looking for if you just want VNC.
Often most AMI's don't have any desktop systems installed as they are generally intended to be run as headless servers. But you should be able to take a base Ubuntu instance, install a desktop system and vnc and then repackage it as an AMI for your own use.

Resources