Windows 7 host on UNetLab


Back again, as promised (albeit a week later than planned).

Today I'll be setting up a Windows 7 host on UNetLab. I did try Windows 10, but it failed to launch after the conversion to qemu.

If you want to play along at home, you'll need a Windows 7 VM running under VirtualBox, UNL (UNetLab) and a bit of time.

The first step is to convert the VirtualBox image's VDI file into RAW:
Stuarts-iMac:VirtualBox VMs stu$ cd Windows\ 7-Pro/
Stuarts-iMac:Windows 7-Pro stu$ ls
Logs   Windows 7-Pro.vbox Windows 7-Pro.vbox-prev Windows 7-Pro.vdi
Stuarts-iMac:Windows 7-Pro stu$ vboxmanage clonehd Windows\ 7-Pro.vdi Win7.img --format RAW
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'RAW'. UUID: a1c6a37c-8988-49a0-b20e-aca2fb22f181
Stuarts-iMac:Windows 7-Pro stu$
Then using Filezilla, or similar, copy it to the /tmp folder on the UNL VM. If you start to run out of room, as I just have, then read Andrea's guide on adding more space to UNetLab.
root@unl01:~# cd /tmp/
root@unl01:/tmp# ls
vmware-root  Win7.img
root@unl01:/tmp# mkdir /opt/unetlab/addons/qemu/win-7-Pro
root@unl01:/tmp# /opt/qemu/bin/qemu-img convert -O qcow2 -f raw Win7.img hda.qcow2
root@unl01:/tmp# mv hda.qcow2 /opt/unetlab/addons/qemu/win-7-Pro/
root@unl01:/tmp# ls /opt/unetlab/addons/qemu/win-7-Pro/
hda.qcow2
root@unl01:/tmp# /opt/unetlab/wrappers/unl_wrapper -a fixpermissions
root@unl01:/tmp#
Now we can make a nice looking topology:


I am using Chicken of the VNC, it seems to work much better than the Mac in-built one. Means connecting is a little bit more manual, but it works well.
So now let's do some basic configuration. I am not testing end-to-end connectivity at this stage, thats for a different post, we are just testing very basic host-to-switch connectivity. I have given the vlan 11 interface on the switch the IP address of 10.1.11.1, and set an IP address on the Windows host of 10.1.11.10, both are using a /24 subnet. The Windows host also has the switch IP address set as it's default gateway:


Awesome, we can ping between them.

See how easy it is to get hosts running in UNetLab?

CCIE #49337, author of CCNA and Beyond, BGP for Cisco Networks, MPLS for Cisco Networks, VPNs and NAT for Cisco Networks.

Related Posts

Previous
Next Post »

17 comments

comments
Anonymous
15 July 2015 at 02:04 delete

Stuard, after when we got hda.qcow2 how could we add windows mashion in our lab? When i press Action -> add node -> Windows i don see any image

Reply
avatar
Anonymous
17 August 2015 at 12:36 delete

Nice Post! :) How are the memory and cpu footprint on UNL when running this inside?

Reply
avatar
17 August 2015 at 12:42 delete

Cheers! So far all is good on the CPU front - but check out my new server build post: http://www.802101.com/2015/08/security-lab-server-build.html - I'll be spinning up more of the security nodes tomorrow and will report back how its handling everything. If you want a good comparison between UNL and VIRL - then check out this twitter link: https://twitter.com/aitaseller/status/629559242844934144 - UNL absolutely spanked VIRL!

Reply
avatar
10 September 2015 at 11:21 delete

I followed your steps and everything were ok .. but after adding the PC and press on start i can see in the right of the screen " Node(s) started, please wait." and no errors messages appear but the machine didn't work .. it still in stopped state !!

Reply
avatar
10 September 2015 at 13:17 delete

do other nodes work ok? You might want to make a forum post (see menu link) for this as the UNetLab guys might be able to help

Reply
avatar
1 October 2015 at 05:52 delete

Hello Stuard. Thank you for you great post. I have a problem with Windows node. Lets go step by step.
Firtly to say, I tried downloaded Windows vmdk and vhd files from internet and also I tried my own vm machines.
1)I created win-7-Pro directory, like you.
2)I copied it to unetlab with WinSCP, then converted it to qcow2 format as you mentioned. But I converted directly form vhd and vmdk files, not .img file like you.
3) then moved it to win-7-Pro directory.
4) I did wrapper fixpermission command, like you.
5) Finally I was able to add Windows image to the topology.
But it didnt boot up. In black screen, it says, no network and bootable devices found.
Please, help me.

Reply
avatar
14 November 2015 at 11:06 delete

Hi Stuart,

Do you know if it's working with win 7 only or win8 can be loaded too ?

Cheers

Reply
avatar
15 November 2015 at 01:49 delete

I know that Windows 10 just does a boot loop, and never seems to recover, not tried 8.1.

Reply
avatar
24 November 2015 at 08:01 delete

Hi Stuart,
after all the assembly made a start, but a blue screen of death.
What could be the problem? Broken image?

Reply
avatar
Anonymous
17 December 2015 at 04:42 delete

Did anyone resolve this problem?
I also runned into problem that there is no image regardless how I try to add it.

Reply
avatar
19 December 2015 at 11:14 delete

can you outline all the steps you went through? Is the folder named correctly?

Reply
avatar
23 February 2016 at 21:15 delete

Hello Stuart, Its seems that I can get the VM to start, but I cannot access it via VNC, is there any tips you could provide?

Reply
avatar
24 February 2016 at 03:49 delete

Need more info, like what VNC client you have installed, if you hover over the node, does it show the vnc:// url, what happens when you try...

Reply
avatar
17 March 2016 at 22:58 delete

I followed the steps but dead blue screen is all I'm getting.

Even safe-mode fails to get in.

Tested the virtual box copy again as it is working fine.

Great progress but something is missing.

Will try to play bit with it later

Reply
avatar
17 June 2016 at 08:50 delete

I hit a number of headaches trying to import it directly. Today I threw my hands up lol, the windows 7 iso directly in my win-7/ dir in UNL. After naming it cdrom.iso, Works like a charm, just needed an empty hda.qcow2 also. I'll give it a go with Windows 2012 later today *fingers crossed*

Reply
avatar
17 June 2016 at 15:13 delete

So Server 2012 works just fine. Got it installed and running now. Again, just need cdrom.iso (windows server 2012 iso) and an empty hda.qcow2.

Reply
avatar
19 June 2016 at 06:04 delete

Thanks Jon. I did try Win 10, but it bluescreened on me constantly.

Reply
avatar