This is possible:
1) Start geth in Terminal first:
> geth --mine
2) Launch Mist, but also from Terminal so you can pass commands to make it connect to the IPC created by geth. On my computer, it looks something like this:
> /Applications/Mist.app/Contents/MacOS/Mist --rpc ~/Library/Ethereum/geth.ipc
Note: you need to change the paths above to correspond with where those files are on your computer and where you're calling them from, as well as the network.
The geth.ipc file is only created/shows up after you have started geth.
For example, another example of this with testnet is:
Terminal 1
> geth --testnet --mine
Terminal 2 (from home folder)
> cd /Applications
> Mist.app/Contents/MacOS/Mist --rpc ~/Library/Ethereum/testnet/geth.ipc
So here i am posting an answer to my own post so that somebody else might get benefited.
Q1. how can i check balance after starting miner?
Ans. you can check the balance by running by attaching geth console but if you dont know where is the ipc file then use below command from your base directory to find the ipc file by this command.
sudo find /home/user/ -name "*.ipc"
this will locate the ipc file location so in my case it was /home/blockchain/medium-article/datadir/geth.ipc
now attach geth console like below command.
sudo geth attach /home/blockchain/medium-article/datadir/geth.ipc
Q2. Should i wait for completion of mining?
Ans. No,you don't have to wait for mining to complete. by following above process you can open geth console.
Q3. how much time it will take to complete?
Ans. Time varies from configuration to configuration.
Best Answer
This occurs when you have another instance of geth already running.
Use your Operating System's process handler to end the process if there are no visible windows.
This happened to me when I started (and then closed) mist before I had set a private network running.