Category Archives: arteq

EVE-NG on win vmware without win

i stopped liking windows a long time ago. In fact i detest it. This morning I realized I was wasting time accessing eve while being hobbled by winblows. With a little research I realized that this:

4.9.40-eve-ng-ukms-2+ GNU/Linux

is actually:

4.9.x LTS

which means it’s actually ubuntu 16.04, and i was happy.

i decided to roll the dice and slap ubuntu desktop on it.

for info on installing and configuring eve-ng, images, client-pack, etc, there is eve-ng.net, youtube, and younameit… this is about using winblows as a silent host to the eve vm. basically, getting it out of the picture.

installing the desktop gui takes quite a while. first i expanded the disk space in vmware for eve from 40 to 100G.

shut down the vm, go to vm–settings, select hard disk, click expand, get coffee.

install ubuntu desktop:

apt-get install-ubuntu-desktop, get coffee, have a smoke; this takes quite a while.

after apt-get, you will boot into the unity desktop. not for me. set up gnome flashback:

apt-get install gnome-session-flashback.

at some point you’ll want to run apt-get update and get more coffee.

reboot, select gnome at login and kiss unity goodbye.

by this time i was already accessing eve-ng from within ubuntu vm without using winblows, on firefox from gnome desktop.

you will need to install the linux-client pack from eve-ng.net to use terminal, telnet, etc.

so far the only downside here is that i’m a zoc user and zoc does not support nix.

first real problem i encountered was native terminal from the gnome gui would not launch. xterm and uxterm would, but not plain terminal with ctrl-alt-t or by clicking it from applications.

the terminal fix is:

$ dpkg-reconfigure locales

You’ll see a long list of locales, and you can navigate that list with the up/down arrow keys. Pressing the space bar toggles the locale under the cursor. Make sure to select at least one UTF-8 locale, for example en_US-UTF-8 is usually supported very well. (The first part of the locale name stands for the language, the second for the country or dialect, and the third for the character encoding).

In the next step you have the option to make one of the previously selected locales the default. Picking a default UTF-8 locale as default is usually a good idea.

next was resolution not holding up between reboots. vm auto-fit, auto size did not help. changing resolution in gnome from the default 800×600 and apply wouldn’t stick between reboots. bash script in startup-applications also did not work.

solution:

write a bash script and save it to an accessible folder:

#!/bin/sh
xrandr –output Virtual1 –mode 1360×768

a couple of key points

must contain #! (sha-bang)
filename must end in .sh
replace Virtual1 (the name gnome gave to my display) with your display name found with xrandr -q

$ xrandr -q
Screen 0: minimum 1 x 1, current 1360 x 768, maximum 4096 x 4096
Virtual1 connected primary 1360×768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
800×600 60.00 + 60.32
1360×768 60.02*
1280×800 59.81
1152×864 75.00
1280×768 59.87
1024×768 60.00
640×480 59.94

you can use xrandr to add a resolution not in the list but since 1360×768 was available, i didn’t bother. have fun with that.

be sure to chmod u+x to make it executable

you can execute the script from terminal and it will change the resolution but will revert across reboots.

solution:

http://xmodulo.com/how-to-automatically-run-script-when-logging-into-ubuntu-desktop.html

more later…

Lubuntu

i have abandoned Lubuntu or LXDE…

what little is saved in space and processing is not worth the sacrifice to the proper functioning of the OS…

 

lubuntu networking notes

hotplug is your friend if you want to use lubuntu network manager and you don’t want the manager spinning all the time.

why even use network-manager?

because you don’t want annoying failsafe timer messages on bootup (main reason)

if you attempt to # out timer messages in failsafe.conf you will cause more headaches for yourself.

to check nm device management

ccie@ccie-virtual-machine:~/os$ nmcli device status
DEVICE     TYPE              STATE
eth2       802-3-ethernet    connected
eth1       802-3-ethernet    disconnected
eth0       802-3-ethernet    unmanaged

this is especially important if you are using more than 1 network virtualization environment and you have a default network config supporting a primary, like virl in my case:

vm_virt_net_ifaces

for each vm you’ll want to customize internal networks as needed.

#The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet manual      # set pass through and use br0 for networking

# Bridge setup
allow-hotplug br0
auto br0 
iface br0 inet static
  address 192.168.0.1
  netmask 255.255.255.0
  network 192.168.0.0
  broadcast 192.168.0.255
  gateway 192.168.0.254    # make sure this gateway address is correct
  bridge_ports eth0        # bind to device here
  bridge_stp off 
  bridge_fd 0
  bridge_maxwait 0

kvm/qemu/vmware notes

make qemu image container

qemu-img create -f qcow2 /var/lib/libvirt/images/exos.img 10G

apply parameters to image container

qemu-system-x86_64 -hda /var/lib/libvirt/images/exos.img -boot order=d -cdrom /home/ccie/os/exospc-16.1.2.14.img -enable-kvm -m 1024M   -cpu host

 disable pxe boot edit vmx and add for each e1000 int:

ethernet0.opromsize = “0”

virt-install (replace parameters as needed)

sudo virt-install –connect qemu:///system -n vm10 -r 512

–vcpus=2 –disk path=/var/lib/libvirt/images/vm10.img,size=10 -c /var/lib/libvirt/images/CentOS-5.6-x86_64-bin-DVD.iso –vnc –noautoconsole –os-type linux –accelerate –network=bridge:br0 –hvm

sudo virt-install –connect qemu:///system -n vm10 -r 512 –vcpus=2 –disk path=/var/lib/libvirt/images/vm10.img,size=12 -c /var/lib/libvirt/images/CentOS-5.6-x86_64-bin-DVD.iso –vnc–noautoconsole –os-type linux –accelerate –network=bridge:br0 –hvm

cli vmware tools install
first go to vm-manage and reinstall, select reinstall. a pop up comes into the vm. then mount
 
sudo mkdir /mnt/cdrom
 
sudo mount /dev/cdrom /mnt/cdrom
mount point is /mnt/cdrom  vmtoo.tar.gz should be there
cd /tmp

sudo tar zxpf /mnt/cdrom/VMwareTools-10.0.5-3228253.tar.gz

umount /dev/cdrom

cd vmware-tools-distrib

     sudo ./vmware-install.pl -d -f
to accept the defaults w/o being prompted and to force install because sometimes it hangs
check vmware tools
gns3@gns3vm:~$ ps -aux | grep vmware
gns3      4869  0.0  0.0  10468   796 pts/0    S+   11:14   0:00 grep –color=auto vmware
gns3@gns3vm:~$
gns3@gns3vm:~$ ps -ef | grep vmware-guestd
gns3      4882  4823  0 11:17 pts/0    00:00:00 grep –color=auto vmware-guestd
gns3@gns3vm:~$ gns3@gns3vm:~$ sudo initctl list | grep vmware
vmware-tools start/running
vmware-tools-thinprint stop/waiting
vmware-tools start/running
vmware-tools-thinprint stop/waiting
load gns3 for ubuntu
sudo add-apt-repository ppa:gns3/ppa
sudo apt-get update
sudo apt-get install gns3-gui
update headers after kernel adds
sudo apt-get install build-essential linux-header-$(uname -r)
sudo apt-get update && sudo apt-get install linux generic
uid and groups belonging to
gns3@gns3vm:~$ id gns3
uid=1000(gns3) gid=1000(gns3) groups=1000(gns3),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),110(sambashare),111(vde2-net),999(docker),105(libvirtd)
ccie@ccie-virtual-machine:~$ id
uid=1000(ccie) gid=1000(ccie) groups=1000(ccie),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),108(lpadmin),118(sambashare),120(libvirtd)
ccie@ccie-virtual-machine:~
uuid generation for kvm
sudo apt-get install uuid
ccie@ccie-virtual-machine:~$ uuid
d4e25b56-0257-11e6-bd66-000c2954b8a3
create a bridge for kvm
 sudo brctl addbr br0
configure the bridge in /etc/network/interfaces
this will cause br0 to assume eth0’s address
auto br0
iface br0 inet dhcp
bridge_ports eth0
bridge_stp off
bridge_fd 0
        bridge_maxwait
sudo /etc/init.d/networking restart, or reboot
make an empty  image file
sudo qemu-img create -f qcow2 /home/ccie/images/ubu-client.img 10G
Now you are ready to start a VM using the domain XML file you created earlier. The following command will create a VM, and automatically start it.
$ sudo virsh create ubu-client.xml
from img create
ccie@ccie-virtual-machine:~$ sudo qemu-img create -f qcow2 /home/ccie/images/ubu-client.img 10G
Formatting ‘/home/ccie/images/ubu-client.img’, fmt=qcow2 size=10737418240 encryption=off cluster_size=65536 lazy_refcounts=off
on ubu for ubu image:
ccie@ubuntu:~$ virsh dumpxml 4f20ae6b-d3e7-6506-5eb1-ebd1efcbf0ea
<domain type=’kvm’>
  <name>ubu-client</name>
  <uuid>d4e25b56-0257-11e6-bd66-000c2954b8a</uuid>
  <memory unit=’KiB’>10737418240</memory>
  <currentMemory unit=’KiB’>10737418240</currentMemory>
  <vcpu placement=’static’>1</vcpu>
  <os>
    <type arch=’x86_64′ machine=’pc-i440fx-trusty’>hvm</type>
    <boot dev=’hd’/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset=’utc’/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type=’file’ device=’disk’>
      <driver name=’qemu’ type=’raw’/>
      <source file=’/home/ccie/images/ubu-client.img’/>
      <target dev=’vda’ bus=’virtio’/>
      <address type=’pci’ domain=’0x0000′ bus=’0x00′ slot=’0x05′ function=’0x0’/>
    </disk>
    <disk type=’file’ device=’cdrom’>
       <driver name="qemu" type="raw"/>
      <source file="/home/ccie/Desktop/ios/lubuntu-14.04-desktop-amd64.iso"/>
      <target dev=’hdc’ bus=’ide’/>
      <readonly/>
      <address type=’drive’ controller=’0′ bus=’1′ target=’0′ unit=’0’/>
    </disk>
  <interface type='bridge'>
      <source bridge='br0'/>
      <mac address="00:0c:29:54:b8:a3"/>
    <controller type=’usb’ index=’0′>
    <address type=’pci’ domain=’0x0000′ bus=’0x00′ slot=’0x01′ function=’0x2’/>
    </controller>
    <controller type=’pci’ index=’0′ model=’pci-root’/>
    <controller type=’ide’ index=’0′>
      <address type=’pci’ domain=’0x0000′ bus=’0x00′ slot=’0x01′ function=’0x1’/>
    </controller>
       </interface>
    <serial type=’pty’>
      <target port=’0’/>
    </serial>
    <console type=’pty’>
      <target type=’serial’ port=’0’/>
    </console>
    <input type=’mouse’ bus=’ps2’/>
    <input type=’keyboard’ bus=’ps2’/>
    <graphics type=’vnc’ port=’-1′ autoport=’yes’ listen='0.0.0.0'/>
    <sound model=’ich6′>
      <address type=’pci’ domain=’0x0000′ bus=’0x00′ slot=’0x04′ function=’0x0’/>
    </sound>
    <video>
      <model type=’cirrus’ vram=’9216′ heads=’1’/>
      <address type=’pci’ domain=’0x0000′ bus=’0x00′ slot=’0x02′ function=’0x0’/>
    </video>
    <memballoon model=’virtio’>
      <address type=’pci’ domain=’0x0000′ bus=’0x00′ slot=’0x06′ function=’0x0’/>
    </memballoon>
  </devices>
</domain>
virt-install
virt-install –name ubu-client –ram 1024 –vcpus=1 \
–disk path=/home/ccie/images/ubu-client.img,size=10 \
--network bridge=br0 \
–cdrom /home/ccie/Desktop/ios/lubuntu-14.04-desktop-amd64.iso \
--graphics vnc --noautoconsole --hvm \
output:
root@ccie-virtual-machine:/home/ccie/images# sudo virt-install –name ubu-client –ram 1024 –vcpus=1 \
> –disk path=/home/ccie/images/ubu-client.img,size=10 \
> –network bridge=br0 \
> –cdrom /home/ccie/Desktop/ios/lubuntu-14.04-desktop-amd64.iso \
> –graphics vnc –noautoconsole –hvm \
> –connect qemu:///system
Starting install…
Creating domain…                                       |    0 B     00:00
Domain installation still in progress. You can reconnect to
the console to complete the installation process.
root@ccie-virtual-machine:/home/ccie/images# sudo virt-install –name ubu-client –ram 1024 –vcpus=1 \
> –disk path=/home/ccie/images/ubu-client.img,size=10 \
> –network bridge=br0 \
> –cdrom /home/ccie/Desktop/ios/lubuntu-14.04-desktop-amd64.iso \
> –graphics vnc –noautoconsole –hvm \
> –connect qemu:///system
Starting install…
Creating domain…                                       |    0 B     00:00
Domain installation still in progress. You can reconnect to
the console to complete the installation process.
virt-install --name vmname --ram 1024 --vcpus=1 \
--disk path=/var/lib/libvirt/images/vmname.img,size=10 \
--network bridge=br0 \
--cdrom /var/lib/libvirt/images/os-install.iso \
--graphics vnc --noautoconsole --hvm \
–os-variant win2k3