Zaki Mirza’s Blog

Icon

… About software and beyond!

quiz #4: My Contextual Switch!

Here’s really deep down dirty one. Even i havnt been able to answer this one as such, but nonetheless here it goes. (I’m taking up the responsibility of being the Teacher Assistant for the operating systems course for a telecommunications batch, i shall try to answer this completely in a short while. Have your shot! )

How do you go about calculating the time it takes to context switch in a unix enviornment?

I read this question somewhere as a question asked in a google interview. Its really intresting and requires a deep knowledge and concept of the core system. (or so i guess?)

Advertisements

Filed under: linux, programming, quiz, , ,

Mounting Windows shared folders in Fedora 6 under vmware

I was lately asked by some taking the Operating systems course for mounting/accessing windows shared folders inside linux installation under vmware virtual machine so here it is. (btw, if you are new to this check out the links i have put in this post for further reference)

Note: this is not a linux/windows security related post. Infact this post might create some security hazards in your enviornment. I do not take the responsibility for any kind of demage since putting security considerations in this problem is out of scope. I expect that these steps are applied in isolated enviornment(no-internet, or atleast firewalled internet). Sharing folders under windows may create security issues.

My Enviornment:

Windows XP sp2.
VMWare version 5.5.1 with vmware tools installed.
Fedora Core 6 Linux (default settings for installation)
Virtual Machine Custom settings (LSI Logic SCSI Harddrive. BusLogic SCSI is not detected by Fedora 6 during installation. either switch it IDE when asked between IDE and SCSI or to LSI Logic SCSI. this is set when creating a new virtual machine. instead of selecting “typical” option, select “custom” option and when asked about SCSI type click in LSI logic SCSI)

I am assuming that you will have the above enviornment or close to it. I also assume that you have not tempered with VMware settings since you installed it. because basically you get two virtual network connections when you install vmware. (to verify, go to control panel>network connections. Vmnet01 and VMnet08 will be connected and firewalled.) VMnet8 is the one we are going to use because it utilizes NAT which you can eventually use to expose linux installation inside your virtual machine to the internet connection in windows XP. To do additional tweaks or settings, vmware provides your with a virtual network editor tool (inside vmware software , edit>virtual network settings) where you can modify DHCP, NAT and other settings. do not temper with them if you have no idea what they mean.

Now on to settings up a shared folder inside windows. Create a folder on you desktop and call it anything (lets call it LINUXSHARE for now). Right click on it and select properties. In the sharing properties, enable sharing for it and check “allow network users to change my files”. Go to control panel>network connections and right click on vmnet8 connection and click properties. enable “show icon in notification area when connected” and click ok. that will show the network’s icon in the notification area of your task bar. right click on it and select “status”. click on support tab and note the IP address alloted to you by the vmnet DHCP server. mine is 192.168.23.1. Yours will be similar as well. DHCP server will allocate IP address to all network connections in this virtual network.

Fire up vmware, and on the home page of your linux installation before starting the virtual machine double click on ethernet icon. In the network connection option, select the “custom” radio button and select vmnet8(NAT) from it. This is the same network that our windows XP is connected to and which is being controllled by the DHCP server.

Start the virtual machine. Login to linux. Hopefully the ethernet card will be detected by your linux distribution and will connect it too. easiest way to connect to the LINUXSHARE folder now in fedora 6 is, goto Places>Network servers. A file browser will open with “busy” icon on your mouse. Thats ok. We’re not dealing with that. Click on File>Connect To Server in that window. A dialog box will apear. in “Service type” select “windows share”. (see picture below)

windows share mounting

Click Connect. If you are lucky, this will take you to your windows shared folder and create a mount point on you desktop as well which will retain between bootups (cool ainnit?:) now you can use this folder in windows and linux both to transfer files.

Another way to do this is by using “mount” (mounting) command under root access. to do that, fireup the terminal. (assuming you have the root access, if not run the “su” command and supply the root password. you will get access of root, if you do not have it, contact your network admin but since we’re installing under vmware i hope you* are the admin). in the terminal type the command

mkdir Desktop/linuxshare
mount -t cifs //192.168.23.1/LINUXSHARE Desktop/linuxshare

Edit:
comment by Bogdan:
Thanks, mounted xp’s shared folder from Topologilinux (cool thing, you may want to try it out). However, for slackware-based Topologilinux the mount command is slightly different:

mount -t smbfs //192.168.23.1/LINUXSHARE Desktop/linuxshare

the only changed thing is from ‘cifs’ to ’smbfs’ filesystem type.

(the above command is case-sensitive. also, use the IP address alloted to your window’s side of the network. the command also requires root access). this command will mount your shared drive on the folder on desktop called linuxshare which is now accessible on both windows and linux. To automate this task on bootup (so that you dont have to run this command over and over again) search the internet for details about “/etc/fstab” file and how to use it to automount drives and network shared folders. The earlier method i mentioned using the GUI is lot more easier though and will not require you to repeat steps everytime you boot your linux distribution (atleast in fedora 6).

If you have any problems feel free to ask. I would highly recommend anyone who is doing operating system assignments in linux to install linux directly on your system and not through a virtual machine and get used to it. Since we’re born with windows we find linux very hard but infact that is really not the case. Heck you are CS students and you think a couple of commands are a pain :s. Here are some good tutorials on linux file system (one of the biggest set back for windows users when shifting to linux). Required is a good habit to learn by one’s ownself and have a sense to explore and conquer.  Linux is a stable, secure, robust and highly efficient operating system which is growing in market every minute. It is used by highend servers and is slowly but steadily moving towards desktops (though desktops was never its target audience. But hey im not gonna start that religious debate). Best of all, its opensource and free. It lets you surf the net securely. You can have all you chat sessions in linux. You can access all your office documents in linux. It is a very fertile programming learning enviornment. And it gives you a sense of satisfaction that you are not using a stolen property. and btw commands are not as bad as people think it is. once you start using them your productivity increases manyfolds. (yes, citations needed) 

ah i know im using windows too right now … im in a serious shifting process to linux enviornment. Just too stuck on some windows application development projects. Im also planning to shift to java for a while and linux development in general. Hope i get to do that soon. (this has nothing to do with microsoft btw. microsoft is also a great company with great minds. I need to scale out and explore more frontiers in computing. I need a more free enviornment. Linux is a huge market and is challenging. Thats what attracts me. Most of all, Ill use windows when i can afford it. )

Till then, happy exploring linux and happy coding. Feel free to drop in feedback or queries about this post so that i can add more scenerios and more people can get advantage of this post.

Filed under: linux, Troubleshooter, windows

Blog Stats

  • 104,467 landed here so far...
November 2017
M T W T F S S
« Jan    
 12345
6789101112
13141516171819
20212223242526
27282930  

tweet

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

RSS Google Shared Items

  • An error has occurred; the feed is probably down. Try again later.

RSS Google Reader Starred Items

  • An error has occurred; the feed is probably down. Try again later.

Top Clicks

  • None