레이블이 virtualbox인 게시물을 표시합니다. 모든 게시물 표시
레이블이 virtualbox인 게시물을 표시합니다. 모든 게시물 표시

2015년 10월 4일 일요일

Disappearing evalauation period days on Win7 trial VM's from Modern.ie

I use Win7 VM's from modern.ie on both a Linux machine (running Archlinux 4.2.2 kernel) and a Win10 machine. The Win7 VM's are very convenient because they give you an evaluation period of 90 days and the trial can be rearmed up to 3 times for a total of 360 days of use. This is irrespective of whether you have saved a snapshot of your VM; once the snapshot is restored, the number of days that have elapsed since the first installation will be used to calculate how many evaluation days you have remaining.

I installed a Win7 VM for a Linux host just 30 days ago, but when I resumed from a save state, the VM told me my evaluation had expired! I thus rearmed the evaluation period using slmgr/rearm from the windows command prompt cmd.exe (which must be run as Administrator). I expected to see that I would be given 90 additional days of use, but I got the following:



From the screenshot (click above to expand) you can see that after the rearm, only 10 days are remaining (although 90 should be granted) and that there are 4 rearms remaining...

On a laptop running Windows 10 (host), the Win7 VM (guest) from modern.ie runs just fine in Virtualbox and the evaluation period counts down correctly. You can see that I have 54 days remaining on this VM:



I wonder what happened to the Win7 VM on the Linux host that caused the evaluation period timer to get messed up...

Postscript Dec. 20, 2015

The first time you boot your new Win7 VM, you will be asked whether you would like to go online to validate your installation (connect to the licensing server). If you don't connect to the licensing server at least once, your VM will only be valid for 10 days. Although it is possible to reset the counter 3 times, unless you validate online you will only be given 10 days of usage at most. After running slmgr/rearm  if you still only have 10 days, run slmgr -ato for activation.

2015년 1월 5일 월요일

Using a Virtualbox VM stored on a shared partition in several different OS'es

  On my notebook I use at work, I have one shared 250 GB btrfs partition that stores all my RHEL, CentOS, Debian/Ubuntu, etc installation .iso images as well as Virtualbox VM .vdi files The remaining space on the 500 GB disk is divided up into separate /boot partitions for various Linux distros while system partitions for each distro reside within LUKS containers containing separate LVM partitions (1 PV, 1 VG, and several logical volumes within the VG for mounting / /home /var and swap).

Since all the Virtualbox .vdi virtual disk images reside on the shared 250 GB partition, within each OS (i.e. Win7, Ubuntu, Arch...) we can import .vdi files into Virtualbox using VBoxManager thereby enabling us to use the VM's from multiple OS'es.

There are some caveats, however. If you want to use the VM's on multiple OS'es, you must not keep any save states; after finishing up your session, be sure to do a proper shutdown of the VM. This is of particular importance for WinXP or Win7 VM's. In the case of XP, I had a saved state residing on CentOS 7, but then I tried to load the VM from Arch which totally corrupted the image making booting no longer possible. In the case of a Win7 VM, even if there are no save states, on the first boot from a new host OS Win7 will restart itself to apply new configurations for the "new" host.

Another issue is that MAC addresses for existing network interfaces are randomized when an existing VM is imported into Virtualbox residing on a different host. This was problematic for me because my CentOS 6.5 VM serves as a PXE installation server. Within the VM there is a single network interface eth0 (note the host OS may have a different name for the wired network interface, i.e. enp1s0 etc) with the following MAC address:


The original MAC for our network interface is 08:00:27:3C:8A:03 but when we imported the CentOS 6.5 VM into Virtualbox on an Archlinux host, Virtualbox randomized the MAC address to another value.

When I started the CentOS 6.5 VM, I noticed that eth0 failed to come up and returned an error, "interface eth0 does not exist", and network interface eth1 was generated by the OS instead. This was problematic because my dhcp server config and PXE install scripts all assume that the network interface is on eth0.

Solution

I shut down the VM and, taking note of the original MAC above, simply replaced the randomized MAC address with 08:00:27:3C:8A:03 in the VBoxManager administration interface. Upon starting the VM once more, eth0 came up at boot without any problems.

2014년 11월 11일 화요일

Setting up OpenDaylight Hydrogen VM - Ubuntu 14.04

On Wednesday and Thursday (Nov. 5 & 6) last week, I participated in my first Hackathon -- Cisco Codefest 2014 -- which was held at the POSCO Engineering and Construction Building main hall 4F in Songdo, South Korea. The track my team chose for the competition was OpenDaylight, a Software Defined Networking (SDN) framework led by the Linux Foundation, Redhat, Cisco, and other partners. This framework enables network devices to be virtualized (NFV - Network Function Virtualization) which opens up the possibility of regular PC's with multiple PCI network cards being able to act as cheap switches, for example, among other possibilities.

Although this contest was a coding competition, our team spent a lot of time doing Linux sysadmin work to get the OpenDaylight VM's into a usable state. We also spent a significant chunk of time learning how to use mininet, the network simulator bundled with the OpenDaylight VM, and setting up network visualization (DLUX - Daylight User Interface) provided by Karaf from the ODL Helium container. This post will walk you through the process of customizing the Ubuntu 14.04 VM available for download from the ODL Hydrogen downloads page (you can navigate here from the main OpenDaylight Downloads page).


Virtualbox Settings for Ubuntu 14.04 VM

As of 2014-11-11 the download link for the Ubuntu 14.04 VM appears as odl-test-desktop-3.ova, but once you actually import it into Virtualbox, the name of the VM appears as odl-test-desktop-2, which is the name of the Ubuntu 13.04 VM available at the second download link in the middle. Here's a screenshot of the page:




I thought I had downloaded the wrong VM, but after verifying with uname -a that the guest OS was running kernel 3.13, I was sure I was running Ubuntu 14.04 (instead of 13.04, the version in the other two VM's available for download). Note that all the Ubuntu ODL images are 64-bit, so if you're running a 32-bit version of say, Windows 7 (or Linux, for that matter), you will not be able to run the VM's even if you have Virtualbox installed (my Codefest teammate actually went out and bought a new laptop because his Core i5 with just 2GB RAM just wasn't up to the task of running the heavy Ubuntu 14.04 VM's).

First, after importing the VM you should first tweak some settings for speed. The download page does mention  "disable 3D acceleration otherwise left menu may not show," (the Unity bar on the left-hand margin) but in my case, leaving 3D acceleration on in the VM display settings also caused problems with my host machine display, making me unable to minimize the VM full-screen window. So you definitely want to make sure that 3D acceleration box is not checked in the following window from the Virtualbox Manager:


Second, from the "System" tab above, you should reduce the number of CPU cores allocated to the VM from 4(!) to something more manageable for your system. Likewise with memory; the memory initially allocated to the VM is 4096MB (4 GB), but I found that for simple topologies 2 CPU cores and 2GB works fine.

Third, from the "Network" tab above, make Adapter 1 attached to "Bridged Adapter" and choose the name of your host machine's network interface. Adapter 1 will provide your VM with Internet access from your host and will also give the VM an IP within the same subnet as your host making ssh possible. You should also enable Adapter 2 as a "Host-only" interface that you can use exclusively for a mininet network. If you do not have any host-only interfaces enabled, click "File" -> "Preferences" -> "Network" from the Virtualbox Manager and select the "Host-only Networks" tab. Click the '+' icon to add one interface (which appears as vboxnet0 in Linux hosts).



Fourth, the VM will not be able to go full screen until you intstall the Virtualbox Guest Additions into the guest OS. Refer to this previous post on my blog for instructions on how to do this in a Linux VM. It would be nice if the people at the ODL foundation actually installed the Virtualbox Guest Additions into the Ubuntu 14.04 VM before exporting it as an .ova file...

Setting up the Application Environment

Fifth, seriously consider installing a lighter Desktop Environment (DE) like XFCE or LXDE. Unity with compiz is installed by default as the Ubuntu 14.04 DE, but its 3D bling, compositing, drop shadows, etc. are superfluous to the job of running network simulations for SDN. In fact, once you launch Karaf (from ODL Helium) and mininet you will find that even powerful systems will lag (my teammate's new machine, a brand-new Core i7 laptop with 256GB SSD and 8GB of RAM ran sluggishly with Unity enabled while running mininet et al). If you run top within the VM while using Unity, it is not uncommon to see compiz taking up 20%+ of CPU.

Don't worry -- installing a new DE does not require the removal of Unity and compiz! Once the new DE is installed through apt-get, you can select what DE to use from the login screen. To install either XFCE or LXDE for Ubuntu, enter one of the following:

sudo apt-get install --no-install-recommends xubuntu-desktop

sudo apt-get install --no-install-recommends lubuntu-desktop

It would also be a good idea to turn off automatic updates... this is a VM, after all, so you should only do point updates for packages that really need it.

Sixth, set up Wireshark. Although it is pre-installed in the VM, running it as the regular user mininet will not allow you to listen to network traffic on any of the network interfaces. That doesn't mean you should run Wireshark as root, however (doing so is a security risk). Instead, run dpkg-reconfigure wireshark-common from the CLI. This will enable regular users to listen on network interfaces as long as they are members of the newly-created user group wireshark. To add user mininet to group wireshark:

sudo usermod -a -G wireshark mininet

For changes to take effect, you must log out and log in once again.

Seventh, install Karaf from ODL Helium. From the main ODL download page, click the link for either the zip or tar archive and extract the files into a folder in the ODL Hydrogen VM. Once you have extracted the files, navigate to the folder and enter the bin directory and invoke karaf as follows:

mininet@mininet-vm:~/distribution-karaf-0.2.0-Helium/bin\> ./karaf

karaf will work with any JVM running Java 1.7 or higher. Fortunately, the Ubuntu VM comes with OpenJDK 7 runtime already installed. Once karaf is installed and running, from the karaf command prompt enter the following to install packages necessary for DLUX:

opendaylight-user@root>feature:install odl-restconf odl-l2switch-switch odl-mdsal-apidocs odl-dlux-core

Now when you create a network in mininet and generate traffic between hosts, you will be able to see the topology by opening a browser within the VM and navigating to localhost:8181/dlux/index.html, logging in with admin:admin, and clicking on "Topology" from the left-hand menu within the browser page body. (Note: If you launch mininet with default settings, it will try to create a network controller on localhost:6633, but this conflicts with the controller created by karaf. To avoid this conflict, you need to specify the IP for a remote controller and a port that doesn't conflict with 6633. In our case, we will use port 6653.)


Example of mininet and karaf in action with topology visualization

Open two terminals within the VM and start karaf in one of them. Once karaf is fully loaded (this can take up to 60 seconds), we will launch mininet with a remote controller residing on the host-only IP for our VM, 192.168.56.101:

mininet@mininet-vm:~\> sudo mn --mac --switch=ovsk,protocols=OpenFlow13 --controller=remote,ip=192.168.56.101,port=6653 --topo=tree,2



We have created a tree topology 2 levels deep (switch 1 is the root node, switches 2 and 3 branch from s1) using an open virtual switch with openflow 1.3

Note that we have changed the controller port to 6653 so that it will not conflict with the karaf controller. Within the mininet command environment, we invoked pingall -c 1 (ping all hosts 1 time) to generate network traffic (if there is no traffic, DLUX will not show any flows). Now navigating to localhost:8181 and navigating to Topology should show the following:


Now your Ubuntu 14.04 VM for ODL Hydrogen should be ready for you to experiment with SDN!

2014년 10월 28일 화요일

Installing Virtualbox Guest Additions iso into a Linux VM

When clicking "install VBox guest additions" from the VBox manager VM context menu on a Windows guest, the Windows installer launches automatically, but things are not as simple on a Linux guest:

1a) From the VBox manager "Devices" menu, click "CD/DVD Devices" -> "Choose a virtual CD/DVD disk file" and navigate to /usr/share/virtualbox and select VBoxGuestAdditions.iso (Note: in Archlinux the location of the the guest additions iso is /usr/lib/virtualbox/additions/VBoxGuestAdditions.iso and is provided by the package virtualbox-guest-iso)



1b) Alternatively, you can click "Insert Guest Additions CD Image" from the VBox Manager "Devices" menu.




2. mount the cd-rom/dvd drive onto a mountpoint. To find the name of the cd-rom you can do

ls /dev/*

which (depending on your machine) will reveal /dev/cdrom or /dev/sr0

sudo mount -o loop,ro /dev/cdrom /mnt/test

3. cd into the mountpoint and run the install script ending in extension .run (don't run the other scripts ending in .sh) as root:

sudo ./VBoxLinuxAdditions.run

4. After rebooting the VM, you should find that mouse pointer integration, full-screen mode, shared clipboard, folder sharing between host and guest machines and other useful features now work.

2014년 9월 15일 월요일

PXE network booting doesn't work in Virtualbox 4.3.16 [SOLVED]

I have been using Virtualbox 4.3.14 in Archlinux to test PXE installation using .iso images for CentOS7 and RHEL6.4

Everything works well in Vbox 4.3.14, but in 4.3.16 after the pxe image is loaded and the pxe menu appears, the vmlinuz kernel image and initrd start loading after the user presses ENTER. Installation proceeds but then Virtualbox suddenly exits the VM and goes back to the Vbox manager screen. The VM has the status 'aborted'.

I searched the Virtualbox Bugtracker for similar issues, but didn't find anything related to pxe in version 4.3.16.

Searching /var/cache/pacman/pkg luckily I found the old versions of 4.3.14 so I was able to downgrade with pacman -U pkgname

In the Vbox manager when I right-click on the VM and select "show log", I can't find any error messages that hint at why the pxe install failed.

The relevant part of VM log starting from LAN boot (PXE):

00:00:03.258185 Guest Log: BIOS: Booting from LAN...
00:00:03.266122 Display::handleDisplayResize(): uScreenId = 0, pvVRAM=0000000000000000 w=720 h=400 bpp=0 cbLine=0x0, flags=0x1
00:00:03.266135 UIFrameBuffer::RequestResize: Screen=0, Format=0, BitsPerPixel=0, BytesPerLine=0, Size=720x400, Sending to async-handler..
00:00:03.266187 UIFrameBufferQImage::resizeEvent: Format=0, BitsPerPixel=0, BytesPerLine=0, Size=720x400
00:00:03.266202 UIFrameBufferQImage::resizeEvent: Resizing to FALLBACK buffer due to format is invalid..
00:00:22.342112 Guest Log: BIOS: KBD: unsupported int 16h function 03
00:00:22.342514 Guest Log: BIOS: AX=0305 BX=0000 CX=0000 DX=0000 
00:00:22.345938 Guest Log: int13_harddisk_ext: function 41, unmapped device for ELDL=81
00:00:22.346524 Guest Log: int13_harddisk: function 02, unmapped device for ELDL=81
00:00:22.347124 Guest Log: int13_harddisk_ext: function 41, unmapped device for ELDL=82
00:00:22.347686 Guest Log: int13_harddisk: function 02, unmapped device for ELDL=82
00:00:22.348285 Guest Log: int13_harddisk_ext: function 41, unmapped device for ELDL=83
00:00:22.348895 Guest Log: int13_harddisk: function 02, unmapped device for ELDL=83
00:00:22.349495 Guest Log: int13_harddisk_ext: function 41, unmapped device for ELDL=84
00:00:22.350077 Guest Log: int13_harddisk: function 02, unmapped device for ELDL=84
00:00:22.350689 Guest Log: int13_harddisk_ext: function 41, unmapped device for ELDL=85
00:00:22.351249 Guest Log: int13_harddisk: function 02, unmapped device for ELDL=85
00:00:22.352083 Guest Log: int13_harddisk_ext: function 41, unmapped device for ELDL=86
00:00:22.352649 Guest Log: int13_harddisk: function 02, unmapped device for ELDL=86
00:00:22.353258 Guest Log: int13_harddisk_ext: function 41, unmapped device for ELDL=87
00:00:22.353821 Guest Log: int13_harddisk: function 02, unmapped device for ELDL=87
00:00:22.354422 Guest Log: int13_harddisk_ext: function 41, unmapped device for ELDL=88
00:00:22.354986 Guest Log: int13_harddisk: function 02, unmapped device for ELDL=88
00:00:22.355595 Guest Log: int13_harddisk_ext: function 41, unmapped device for ELDL=89
00:00:22.356167 Guest Log: int13_harddisk: function 02, unmapped device for ELDL=89
00:00:22.356782 Guest Log: int13_harddisk_ext: function 41, unmapped device for ELDL=8a
00:00:22.357349 Guest Log: int13_harddisk: function 02, unmapped device for ELDL=8a
00:00:22.357950 Guest Log: int13_harddisk_ext: function 41, unmapped device for ELDL=8b
00:00:22.358532 Guest Log: int13_harddisk: function 02, unmapped device for ELDL=8b
00:00:22.359132 Guest Log: int13_harddisk_ext: function 41, unmapped device for ELDL=8c
00:00:22.359694 Guest Log: int13_harddisk: function 02, unmapped device for ELDL=8c
00:00:22.360318 Guest Log: int13_harddisk_ext: function 41, unmapped device for ELDL=8d
00:00:22.360880 Guest Log: int13_harddisk: function 02, unmapped device for ELDL=8d
00:00:22.361478 Guest Log: int13_harddisk_ext: function 41, unmapped device for ELDL=8e
00:00:22.362122 Guest Log: int13_harddisk: function 02, unmapped device for ELDL=8e
00:00:22.362765 Guest Log: int13_harddisk_ext: function 41, unmapped device for ELDL=8f
00:00:22.363332 Guest Log: int13_harddisk: function 02, unmapped device for ELDL=8f
00:00:23.009453 PIT: mode=2 count=0x4a9 (1193) - 1000.15 Hz (ch=0)
00:00:23.671500 PIT: mode=0 count=0x10000 (65536) - 18.20 Hz (ch=0)
00:00:30.647365 EHCI: Hardware reset
00:00:30.649658 EHCI: Hardware reset
00:00:30.649717 EHCI: USB Operational

The last entry is that USB is operational, there are no error messages...For the time being I'm just going to use Virtualbox 4.3.14 and file a new bug report. Has anyone else had similar problems with 4.3.16?

Postscript 2014-10-8
In Virtualbox 4.3.16 r95972 on CentOS 7 (in Archlinux I believe this is 4.3.16-4) PXE network booting within VM's works just fine.

I suspect that the problems I had with Virtualbox 4.3.16 in Archlinux were due to some configuration problems with virtualbox dkms kernel modules.

2014년 4월 15일 화요일

WinXP VM provided by Microsoft (ModernIE) is very useful for the Korean ActiveX web environment

I'm a happy user of Virtualbox on Linux. I mostly use Virtualbox to run WinXP guests on my Linux host so I can use Korean Internet banking services and shop online in Korea. You might ask, "Why do you need an ancient Windows OS just to do Internet banking?"

Some background on this situation: in the late 1990's, prescient Korean bureaucrats decided to implement PKI (Public Key Infrastructure) for all online transactions. Since existing open standards for PKI were still in the early stages back then, the Korean gov't rolled their own solution which was implemented through ActiveX plugins for Microsoft's Internet Explorer web browser.

Fast forward 15 years -- the web has evolved but the Korean PKI standard is still unchanged and all Koreans are forced to keep using old ActiveX plugins which have been left in the dustbin of history. Shopping and banking online in Korea is a hugely frustrating experience, as you must download and install new ActiveX plugins almost every time you start a new session. Although nominal Internet speeds are quite fast (several times the speed of American Internet) in practice most Korean users cannot benefit due to all the cruft they are forced to install to use native Korean Internet services (which are still optimized for the IE8 web browser).

Although IE has > 80% market share in Korea, online banking and shopping sites only support IE's older incarnations. Good luck getting modern versions of IE (11+) working on, say, the websites of Woori Bank or Auction Korea.

On modern Windows OS's, however, more recent versions of IE are installed by default. If you're one of the millions of Koreans still using WinXP, that's not a problem because IE8 is the most recent version of IE compatible with that venerable OS. For those not using XP, however, using the Korean Internet is often problematic. For example, my girlfriend's computer runs Windows 7 with a modern version of IE but she sometimes can't use certain Korean sites requiring ActiveX.

The solution? Use virtualization -- Virtualbox, VMWare, Parallels, etc. As I mentioned earlier, I use Oracle's Virtualbox. In the past I installed WinXP onto a fresh VM using an old .iso from MSDN. Even the most slimmed-down install with extraneous features omitted came in at just under 10 GB with no custom applications installed.

Whether using dynamically-allocated partitions or not in Virtualbox, after installing a few key applications for Korean banking, shopping and word processing (in the form of Hancom's infamous 한글 200x series) partitions soon balloon to 15GB or more.

Enter WinXP VM's provided directly by Microsoft through their ModernIE site -- for Virtualbox on Linux, we import a compressed OVA file that blows up to a regular VMDK image file. The bare-bones WinXP VM only takes up 1.9 GB on initial boot! Compare that to ~ 10 GB for a clean install from .iso or CD.

For users in East Asia, however, the VM cannot be used as-is because the default VM image is of a US version of Windows. Prepping the VM requires the following steps (which requires a WinXP install CD or .iso from MSDN):

1) Extract the necessary install files from the WinXP install CD or .iso - extract the entire /i386 directory from the .iso to some directory, then use the Virtualbox "shared folder" feature to make this directory readable by the WinXP guest.

2) Enable East Asian Font Support -- go into Control Panel and select "Regional Settings & Languages" and make sure the box for "East Asian Language support" is checked. The installer will then ask for the WinXP CD or a location where the installation files reside. If we point the installer to the shared folder /i386/... the language file installation will go forward. The path changes a few times during the install, so you may need to enter the /lang subfolder and then later point to the parent folder again.

3) Install East Asian Language IME (Korean, in my case) - go into Control Panel and select "Regional Settings & Languages" once more but this time click on "input methods" instead of "languages"-- now choose Korean and make it the default. After a reboot, pressing the Hangul key (Right Alt on non-Korean keyboards) will toggle Korean language input.

There are also some Virtualbox-specific VM settings that you might want to change. The default memory setting is 512MB, but I changed this to 1024MB. Also I had problems booting the VM before enabling the Virtualbox "System" option, I/O APIC. For those users who store their Korean banking PKI certs on a USB thumb drive, you will need to enable USB 2.0 in the VM settings and also separately download the Oracle VM VirtualBox Extension Pack and load it from the Virtualbox Manager (under File -> Preferences -> Extensions).

Rearming the WinXP VM after 30 days

Note that the WinXP VM's from ModernIE will only run for 30 days. After that, a dialog box will appear at boot asking you whether you want to activate your copy of Windows. If you click 'No', the system will automatically reboot. Microsoft initially said that taking a snapshot image upon first importing the VM and later restoring that image would reset the activation clock, but this is actually not the case!

When 30 days have expired, what I do is restore a clean snapshot (which will still ask for activation) and then boot into Safe Mode (pressing F8 to bring up the Windows boot menu and selecting 'Safe Mode'). After booting open a Command Prompt and type the following:

rundll32.exe syssetup,SetupOobeBnk

Even with a successful activation, there will be no output.

Now reboot into a regular session and the activation clock will be reset to give you 30 more days!

Although Microsoft says that the WinXP VM activation counter can be reset up to 3 times (for a total of 90 days), by restoring a snapshot from a clean install and booting into WinXP Safe Mode and resetting the activation from the command prompt/CLI I've been able to use the same VM for more than 90 days!