Cleanup and Removal of components before shippng of VM


NAS

Recommended Posts

Forked from owncloud VM thread. When building a VM to share or run more than once there are a number of things that need dealt with.

 

For instance SSH keys are typical created on first install of sshd (aka bad if lots of people have same)

 

 

The purpose of this thread is to identify these and potentially come up with simple generic solutions:

 

So far these come to mind (some may be covered by some virtual software):

 

*SSH keys

*SSL keys

*All python usenet tools that have API keys e.g. sab, sickbeard etc

*apt-cache or similar

*bash history

*virtual MAC

Link to comment

...

 

I generated a unique mac address.  I would suggest that you generate a random mac address for yourself and not use the mac address configured in the package.

 

Here's a perl script to generate a random mac address:

#!/bin/bash
perl -e 'printf "00:16:3E:%02X:%02X:%02X\n", rand 0xFF, rand 0xFF, rand 0xFF'

 

...

Link to comment

i think you can do something like this in the cfg file to give you a random mac address:-

 

vif = [ 'mac=00:16:3e:XX:XX:XX,bridge=xenbr0' ]

 

this should then give you a random mac address, disclaimer - untested as waiting on b4  8)

 

personally i like to identify the machine via mac by including the ip address in the mac, so for me i use 192.168.1.0/24 network, and if i say allocated my vm an ip of 192.168.1.10 then i would change my mac to be 00:16:3e:00:01:10, just my own personal preferenace but i thought i would put it out there  :D obviously this would not work if the ip for the vm is > 99 :-)

 

 

Link to comment

i think you can do something like this in the cfg file to give you a random mac address:-

 

vif = [ 'mac=00:16:3e:XX:XX:XX,bridge=xenbr0' ]

 

this should then give you a random mac address, disclaimer - untested as waiting on b4  8)

 

personally i like to identify the machine via mac by including the ip address in the mac, so for me i use 192.168.1.0/24 network, and if i say allocated my vm an ip of 192.168.1.10 then i would change my mac to be 00:16:3e:00:01:10, just my own personal preferenace but i thought i would put it out there  :D obviously this would not work if the ip for the vm is > 99 :-)

 

If you are going to reserve an IP address with your router, you would want a fixed mac address for the VM.  This method would generate a new mac address every time the VM was started.

 

Once you generated a mac address though, you could then go back and change the .cfg file for the fixed mac address.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.